0
How do I make checkboxes mark when the user enters values in the two fields?
<td class="col-xs-2 col-sm-2 col-md-2 col-lg-2" ><input type="number" max="20" min="0" size="1" maxlength="2" name="<?php echo 'scorea'.$n; ?>" value="{{ old('scorea' . $n) }}" > </td>
<td> X </td>
<td class="col-xs-2 col-sm-2 col-md-2 col-lg-2"> <input type="number" max="20" min="0" size="1" maxlength="2" name="<?php echo 'scoreb'.$n; ?>" value="{{ old('scoreb' . $n) }}" ></td>
<td class="col-xs-2 col-sm-2 col-md-2 col-lg-2"> <?php echo $c->timeb; ?> </td>
<td class="col-xs-2 col-sm-2 col-md-2 col-lg-2"> <?php echo $c->campeonato; ?> </td>
<td class="col-xs-2 col-sm-2 col-md-2 col-lg-2"> <INPUT TYPE="checkbox" NAME="<?php echo 'jogo'.$n; ?>" VALUE="true">
</tr>
Should both fields be filled in to check the checkbox? And is it really necessary to create the fields with these names? If they represent the same thing, it would no longer be convenient to store them in a field with name
scoreA[]
andscoreB[]
, creating a list of values?– Woss
no, because it is a loop.... and can appear 'n' lines. so I want only checkbox of filled inputs to be marked.
– Dan Even
Put more example of your code, preferably where the loop occurs!
– PV Telles