this is my javascript code how to validate
<-----this is my java script--------->
<!-------this is my form validation------->
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
Use this link, please:
https://www.absolutewebdev.com/tutorials.php?result=8&topic=Validating_a_form_using_JavaScript_Regular_Expressions
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
JavaJSPJSF