This is a script that I use. You will have to customise it to your own circumstances. What this scipt does is:
verifies that the first email address is a valid email address
verifies that the second email address is a valid email address
verifies that the two addresses are the same
Just set up your form to call this function on Submit.
<script>
var re = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"
var alpha = new RegExp("[a-zA-Z]"var digit = new RegExp("[0-9]"var truecount=0;
function valid(){
truecount=0;
mail1=document.RequestLogin.pwemail1.value;if(!re.test(mail1)){alert("You must enter a valid email address in the 'Email Address' field"truecount=0;return false;} else {truecount++;}
mail2=document.RequestLogin.pwemail2.value;if(!re.test(mail2)){alert("You must enter a valid email address in the 'Retype Email Address' field."truecount=0;return false;} else {truecount++;}
if(mail1 != mail2){alert("Your email addresses do not match. Please retype."truecount=0;return false;} else {truecount++;}
if(truecount==3){return true;} else { truecount=0; } }
</script> Mise Le Meas,
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.