Also another qu

admin

Administrator
Staff member
Hello guys. Another question too.I will paste my script below, I was wondering instead of bringing up 'seperate' alerts, it would just bring them up in one box like 'The following fields were misformed, please retry:' and then list them. At the moment it comes up all seperately. Here's the HEAD script:<script language="javascript"><!--function simpleCheck(form) {if (!/^[a-z0-9]+$/i.test(form.newuser.value)) {alert("Please include your desired use.");form.newuser.select(); }else if (form.userPASS.value =="") {alert("Please include your desired user password.");form.userPASS.select(); }else if (form.userRPTPASS.value =="") {alert("Please repeat your desired user password.");form.userRPTPASS.select(); }else if (form.userPASS.value != form.userRPTPASS.value){alert("Your passwords did not match, please try again.");}else if (!/^\w+@\w+\.[a-z]{2,3}(\.[a-z]{2})?$/i.test(form.userEMAIL.value)) {alert("Please include your e-mail address. It should be in the format of <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->.");form.userEMAIL.select(); }else if (form.policyON.checked==false) {alert("You forgot to tick the box stating you agree to our terms.");form.policyON.select(); }else {form.method="POST";form.target="_self"form.submit();}}//--></script>Now, the BODY script: <form onSubmit="simpleCheck(this); return false;" form action="http://my post script" method="POST">Thanks!
 
Back
Top