{ alert("The email is not correct"); return false; } for (var i=1; i<20; i++) { if (f.elements["np" + i] && f.elements["np" + i].required && f.elements["np" + i].value == "") { alert(""); return false; } } if (f.elements["ny"] && !f.elements["ny"].checked) { alert("You must accept the privacy statement"); return false; } return true; } } //]]>

References   [ + ]

1. [a-zA-Z0-9\-]{1,})+\.)+([a-zA-Z0-9]{2,})+$/; if (!re.test(f.elements["ne"].value