Posted By

cerxx on 08/27/19


Tagged

HTML-FORMS


Versions (?)

PROHIBITING SENDING THE FORM UNTIL THE FLAGS IS INSTALLED


 / Published in: HTML
 

URL: https://atuin.ru/blog/zapret-otpravki-formy-poka-ne-ustanovlen-flazhok/

Very simple method of prohibiting form submission until checkbox is checked

  1. <div class="formname">
  2. <input id="checkbox" type="checkbox" name="checkbox" onchange="document.getElementById('submit').disabled = !this.checked;" />
  3. <label for="checkbox">I hereby confirm that I agree</label>
  4. <input type="submit" disabled="disabled" name="submit" id="submit" value="?????????" />
  5. </div>

Report this snippet  

You need to login to post a comment.