mardi 17 janvier 2017

fill text input when checking jquery

i have a loop in my laravel project which contain checkbox and input

@foreach($s as $sh)
<tr>
<td><input type="checkbox" name="service_id[]" class="checkser" value=""></td>
<td class="checkservice"></td>
<td> <input type="text" class="form-control checkser inputservice" placeholder="" name="ser_quantity[]" ></td>
<td></td>
</tr>
@endforeach

i need to fill text input with (1) when checkbox checked
and empty this when checkbox unchecked

i tried many method but failed to work this with next input only

Aucun commentaire:

Enregistrer un commentaire