I have form that has numerous checkboxes and input field.
Each 'pair' of checkbox & input have the same name, but the checkboxes name is prefixed with u_
eg:
<input type='checkbox' name='u_id'><input type="text" name="id" placeholder="ABC123">
<input type='checkbox' name='u_name'><input type="text" name="name" placeholder="Martin">
I'm trying to work out how to disable in the input field and set it's placehold to 'disabled' when the associated checkbox is ticket.
If it is then unticked, rest the field and it's placeholder.
So far I've got :
if ($('[name^="u_"]').is(':checked')) {
}
But I'm not sure where to go now..
Can you help ?
Thanks