/* Submit Once form validation- © Dynamic Drive (www.dynamicdrive.com) the following functions cover verification for log in forms verification for e-mail forms is covered in formverify_b.js */ function submitonce(f){ //if IE 4+ or NS 6+ if (document.all||document.getElementById){ //screen thru every element in the form, and hunt down "submit" and "reset" for (i=0;i -1) return false } atPos = e.indexOf("@",1) // there must be one "@" symbol if (atPos == -1) return false if (e.indexOf("@",atPos+1) != -1) // and only one "@" symbol return false periodPos = e.indexOf(".",atPos) if (periodPos == -1) // and at least one "." after the "@" return false if (periodPos+3 > e.length) // and at least 2 chars after the "." return false return true } function action(f,msg,pre,wgt) { if (pre == 1) { msg = "Please enter "+msg } alert(msg); f.elements[wgt].focus(); f.elements[wgt].select(); return false; } function submitlogin(f) { if (f.f_email.value == "") { action(f,"an e-mail address",1,"f_email"); return false; } else { if (!validEmail(f.f_email.value)) { action(f,"The e-mail address that you have\nentered does not appear to be valid.",0,"f_email"); return false; } } if (f.f_pass.value == "") { action(f,"a password",1,"f_pass"); return false; } submitonce(f); return true }