vendredi 6 mai 2016

Checkbox value true/false

I have a form with checkbox. After submiting the form, on another page the checkbox must be checked if its true of false. I heard that the value attribute can be checked there so im trying to set it. Anyway, the input value stays "false" even if i click it. What happens exactly?

<input type="checkbox" name="acceptRules" class="inline checkbox" id="checkbox1" value="false">

      <script>
          $("#checkbox1").is(':checked', function(){
              $("#checkbox1").attr('value', 'true');
          });
      </script>




Aucun commentaire:

Enregistrer un commentaire