htmlauthenticationcheckboxsubmitwireless

HTML checkbox & Submit Button by Agreeing on Terms and Condition


I'm designing an html page for WiFi authentication and I would like to introduce in this page a Checkbox and Submit button, upon reading the Terms and Condition and Checking the CheckBox, the Submit button will be active.

Is this doable?

thanks,


Solution

  • <html>
    <head>
    <script>
     function disableSubmit() {
      document.getElementById("submit").disabled = true;
     }
    
      function activateButton(element) {
        
          if(element.checked) {
            document.getElementById("submit").disabled = false;
           }
           else  {
            document.getElementById("submit").disabled = true;
          }
      
      }
    </script>
    </head>
    
    <body onload="disableSubmit()">
     <input type="checkbox" name="terms" id="terms" onchange="activateButton(this)">  I Agree Terms & Conditions
      <input type="submit" name="submit" id="submit">
    </body>
    </html>