Skip to content
Advertisement

enable/disable generated input by array with relevant checkbox jQuery

How can I enable input field generated in result of a loop from array along with checkbox. I trying to disable the generated input fields and enable the one only when particular corresponding checkbox is checked. I’ve tried to follow this example enable disable inputs text with its corresponding checkbox jquery but couldn’t help my self.

$voucher array:

JavaScript

SOURCE:

JavaScript

HTML:

JavaScript

JS:

JavaScript

RESULT:

enter image description here

Advertisement

Answer

Can you slightly modify your code? You can try the below solution.

SOURCE :

JavaScript

This will produce the HTML :

JavaScript

And finally your JS will be :

JavaScript

Hope this will help. Let me know if any issue.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement