How do I get textbox values from a gridview template field using jQuery.
I want to get textbox values from a gridview template field using jQuery.
Example:
ID -- Name --- Age 1 --- Hung ---- Textbox has value : 20 2 --- John --开发者_如何学JAVA-- Texbox has value : 19
How do I get the textbox values 20 or 19 (depending upon clicking) when I click the first or second row of textboxes using jQuery?
Thanks all!
if you are using a jquery grid (jQgrid, INGrid etc).. then the methods to access the field values comes as part of the api.
if you have a table & want to access the data then you can say.
$(':text").click(function(){
alert($(this).val());
// do something with the field data.
// here $(this) refers to the field on which the user clicked on.
});
hope this helps.
精彩评论