Jquery Hidden Field in Table

Posted by zSysop on Stack Overflow See other posts from Stack Overflow or by zSysop
Published on 2009-03-31T15:07:43Z Indexed on 2010/12/22 2:54 UTC
Read the original article Hit count: 245

Filed under:
|
|
|
|

Hi all,

I was wondering if anyone knew of a way to access a hidden field (by client id) within a table row using jquery.

$("#tblOne").find("tr").click(function() {
            var worker = $(this).find(":input").val();
        });

I find that the above works for a row that has only one input, but i need some help figuring out a way to get the value by the inputs name.

Here's the example of a table row. How would i access the two fields by their id's?

<table id="tblOne">
<tr>
<td>
    <asp:HiddenField id="hdnfld_Id" Text='<% Eval("ID") %>'></asp:HiddenField>
</td>
<td>
    <asp:HiddenField id="hdnfld_Id2" Text='<% Eval("ID2") %>'></asp:HiddenField>
</td>
</tr> 
</table>

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery