function validateForm(theForm)
{
var errReport = "";
errReport += validUsername(theForm.username);
if (errReport != "")
{
alert("The was a problem with the following field(s):\n" + errReport);
return false;
}
return true;
}
//form validation close //
//valid username //
function validUsername(fld)
{
var error = "";
var valid = /^[a-zA-Z0-9]+$/;
if (fld.value == "")
{
fld.style.borderColor = '#ff0000';
document.getElementById('username').style
1
Expert's answer
2012-10-25T11:42:24-0400
Use this link, please: https://www.absolutewebdev.com/tutorials.php?result=8&topic=Validating_a_form_using_JavaScript_Regular_Expressions
Comments
Leave a comment