ciao a tutti,
sto cercando di far si che quando clicco nel campo input si seleziona automaticamente il checkbox.
Il problema è che indipendentemente dall'input in cui clicco si seleziona soltanto il primo checkbox. Allego l'immagine per una maggiore chiarezza e il codice HTML
codice HTML:
<tr>
<td class="list-ID" style="text-align:center"><?php echo $productID; ?></td>
<td class="list-ID" style="width: 15px !important;padding-right:5px; text-align:right"><input type="checkbox" id="check" name="productEdit[]" style="width:13px; height:13px" /></td>
<td class="list-NA">
<input type='hidden' name='list-ID[]' value='<?php echo $productID; ?>'/>
<input class="list-NA" type="text" maxlength="50" style="width:100%;" name="productName[]" onfocus="document.getElementById('check').checked=true" value="<?php echo $productNA;?>" />
</td>
<td class="list-DE">
<input class="list-DE" type="text" maxlength="50" style="width:100%;" name="productDesc[]" onfocus="document.getElementById('check').checked=true" value="<?php echo $productDE;?>" />
</td>
</tr>