jquery find input:hidden error in safari -
i'm trying implement feature user can click on row i.e., <tr>
, , it'll go specific url.
here's html , jquery code:
<tbody> <tr> <input class="threadid_c" id="threadid" name="threadid" type="hidden" value="mzawmtywldmwmdm3miw=" /> <td> ... </tr> <tr> <input class="threadid_c" id="threadid" name="threadid" type="hidden" value="mzawmzcyldmwmdm4mcw=" /> <td> .... $('#datatable tr').click(function() { var x = $(this).find("input:hidden"); var url = "/user/ping/" + x.val(); location.href = url; });
this works fine in chrome, firefox, , ie. in safari, x.val()
returns undefined
.
i looked in safari's javascript console, see message:
<input> not allowed inside <tr>. inserting <input> before <table> instead.
not sure if that's related problem. suggestions?
you can't have <input>
direct <tr>
child says, tuck inside first <td>
instead, this:
<tr> <td> <input class="threadid_c" name="threadid" type="hidden" value="mzawmzcyldmwmdm4mcw=" /> ....
also remove id
attribute since it's repeated...they should unique in page.
Comments
Post a Comment