\n\n\n
\n
\n

I agree to the terms of services

\n

\n\n
\n
\n\n\n\n","answerCount":2,"upvoteCount":1,"acceptedAnswer":{"@type":"Answer","text":"\n\n \n\n\n
\n
\n

I agree to the terms of services

\n

\n\n
\n
\n\n\n\n","upvoteCount":1},"suggestedAnswer":[{"@type":"Answer","text":"Thank you so much Basel Al_hajeri ?.`MBH`","upvoteCount":1}]} }
+ 1

Alert to tick a check box if the form is submitted without ticking it.Please find the error in this. Thanks in advance.

Here's my code <html> <head> <script> function checkbox() { if(check.checked == false) { alert("Please accept our terms and conditions!") return false; } return true; } </script> </head> <body> <div class="sign-up-form"> <form name="signup" onSubmit="return validateform()" action="WelcomeTechnoWorld.html" method="post"> <p><span><input name="check" type="checkbox"></span> I agree to the terms of services</p> <p> <input type="submit" class="signup-btn"> </p> </form> </div> </body> </html>

24th May 2020, 9:12 AM
O.Naga Lakshmi Lalasa
O.Naga Lakshmi Lalasa - avatar
2 Answers
+ 1
<html> <head> <script> function checkbox() { if(document.signup.check.checked === false) { alert("Please accept our terms and conditions!") return false; } return true; } </script> </head> <body> <div class="sign-up-form"> <form name="signup" onsubmit="return checkbox()" action="WelcomeTechnoWorld.html" method="post"> <p><span><input name="check" type="checkbox"></span> I agree to the terms of services</p> <p> <input type="submit" class="signup-btn"> </p> </form> </div> </body> </html>
24th May 2020, 10:04 AM
Basel.Al_hajeri?.MBH()
Basel.Al_hajeri?.MBH() - avatar
+ 1
24th May 2020, 1:13 PM
O.Naga Lakshmi Lalasa
O.Naga Lakshmi Lalasa - avatar