Link to home
Start Free TrialLog in
Avatar of Rahul Sehrawat
Rahul Sehrawat

asked on

Checkbox if corresponding checkbox is checked

Hi Experts,

I have a table with the dynamic fields (can be added by the user) and the structure is like this:

<table>
<tr>
<td><input name="key[]" value="" type="checkbox"></td>
<td><input name="index[]" value="" type="checkbox"></td>
</tr>

<tr>
<td><input name="key[]" value="" type="checkbox"></td>
<td><input name="index[]" value="" type="checkbox"></td>
</tr>

<tr>
<td><input name="key[]" value="" type="checkbox"></td>
<td><input name="index[]" value="" type="checkbox"></td>
</tr>

<tr>
<td><input name="key[]" value="" type="checkbox"></td>
<td><input name="index[]" value="" type="checkbox"></td>
</tr>
</table>

Open in new window


What I want is that the index key can only be checked if the corresponding key checkbox is checked, if the key checkbox is unchecked it should make sure to uncheck the index key as well.

I am really confused. How can I do it? thanks
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rahul Sehrawat
Rahul Sehrawat

ASKER

Thanks for the idea. It really helped me alot