1

I'm trying to select values of text fields in a table, using jQuery.Select function. But it's not working. Here is it's jsFiddle: - https://jsfiddle.net/zkcxoyzL/3/

jQuery Code:

$(function(){
   $("#acquisition_table").on("focus", "[type='text']", function () {
                $(this).select();
   });
});

It seems, it selects and automatically deselects within fraction of a second.

trex
  • 3,848
  • 4
  • 31
  • 54
  • Here is the solution http://stackoverflow.com/questions/5797539/jquery-select-all-text-from-a-textarea – Kerem Aug 03 '15 at 12:02

1 Answers1

2

$(function() { $("#acquisition_table").on("focus", "[type='text']", function () { var $this = $(this); $this.select(); // Work around Chrome's little problem $this.mouseup(function() { // Prevent further mouseup intervention $this.unbind("mouseup"); return false; }); }); });

Taken from https://stackoverflow.com/a/5797700/1139130

Community
  • 1
  • 1
Kerem
  • 317
  • 1
  • 14