Javascript alert issue on form: Alert prompt keeps appearing -
can't provide link project due nda, hopefully, code i'll post more sufficient solve this.
i'm doing simple php contact form. nothing crazy. 2 text input fields , checkbox validate age. if leave form unchecked, can't enter contest.
i have validation working....to point. here's happening. when keep checkbox unchecked , try submit form, alert prompt saying i'm not 18 or over. js this:
if (!document.forms[0].age.checked) { alert("sorry, must on 18 enter...please check on 18 box proceed"); }
that works, , click "ok", alert prompt comes back! , i'm stuck in loop.
anyone know how can form work?
have tried
if (!document.forms[0].age.checked) { alert("sorry, must on 18 enter...please check on 18 box proceed"); return false; }
Comments
Post a Comment