Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Required fields*

jQuery: Getting value from input array

We have the following form:

<form>
...
 <table width="100%" cellspacing="0" class="datagrid_ppal">
 <tbody>
 <tr>
 <th scope="row">Area 1 <input name="config_line" type="hidden" value="0,5,50" /></th>
 <td class="gantt"> </td>
 <td class="gantt"> </td>
 <td class="gantt"> </td>
 ...
 </tr>
 </tbody>
 </table width="100%" cellspacing="0" class="datagrid_ppal">
...
<form>

What we need is to get the first, second or third from the hidden input value. We have tried this and didn't work:

 var value = $('th').children('input:hidden').val();

Can anyone help us? We would really appreciate it.

Answer*

Draft saved
Draft discarded
Cancel
2
  • sorry, didn't see that. you can also use $('input[name=config_line]') as selector Commented Jun 1, 2010 at 14:40
  • Please change your answer, #config_line can be misleading. Commented Jun 1, 2010 at 15:12

lang-js

AltStyle によって変換されたページ (->オリジナル) /