The below is a snippet
<form name="form1" method="post" action="index_1.php" enctype="multipart/form-data"><br />
Mobile : <input name="Mobile" id="Mobile" type="text"><br><br>
<center><input id="submit" name="submit" type="submit" value="Submit" onclick="javascript:return validateMyForm();"/></center>
</form>
and for validation, the JS is
function validateMyForm ( ) {
var isValid = true;
if ( document.form1.Mobile.value == "" ) {
alert ( "Please enter your mobile number" );
isValid = false;
}
return isValid;
}
How do I validate with a criteria like this " /^(+91-|+91|0)?\d{10}$/" " ???