loop through checkboxes to enable/disable multiple inputs

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 : 

  1. <table> 
  2. <tr> 
  3. <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> 
  4. </tr> 
  5. </table>                                                                              

I tried :

  1. jQuery(".idPlant").change(function(){
  2.     $('.date').each(function(){
  3.       $(this).prop('disabled', true);
  4.       return false;
  5. })
  1.     $('.quantity').each(function(){
  2.       $(this).prop('disabled', true);
  3.       return false;
  4. })
  1. });



but the code doesn't work.

thanks