loop through checkboxes to enable/disable multiple inputs
Hello
How can I loop through the following form : if I check each checkbox, I would like to enable ans disable multiple inputs matched with the checkbox. The form is created dynamically with a select from my database :
- <table>
- <tr>
- <td><input type="text" name="idRow[]" class="idRow" value=""></td><td><input type ="date" name="date[]" class="date" value = ""></td><td></td> <td><input type ="number" name="quantity[]" class="quantity" id="" value= "" /> UN</td>
- </tr>
- </table>
I tried :
- jQuery(".idPlant").change(function(){
- $('.date').each(function(){
- $(this).prop('disabled', true);
- return false;
- })
- $('.quantity').each(function(){
- $(this).prop('disabled', true);
- return false;
- })
- });
but the code doesn't work.
thanks