Here is an example of how you can achieve the validation requirement and redirect the page to the desired URL. Let me know if you face any issues.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script>
function validate(){
var phoneNo = document.getElementById('p
hone').val
ue;
var url = "
http://www.merchantaccountlab.com/netcall.asp";
if(phoneNo.length == 0){
alert('Please Enter Phone Number');
return false;
}
if(phoneNo.indexOf("/") > -1 && phoneNo.indexOf("-") > -1){
alert('Please Remove Slash And Hyphen');
return false;
}
if(phoneNo.indexOf("/") > -1){
alert('Please Remove Slash');
return false;
}
if(phoneNo.indexOf("-") > -1){
alert('Please Remove Hyphen');
return false;
}
for (var i=0; i<phoneNo.length; i++) {
if ("0123456789".indexOf(phon
eNo.charAt
(i)) == -1) {
alert('Please Enter Numbers Only');
return false;
}
}
if(phoneNo.length > 10){
window.location.replace(ur
l);
return false;
}
return true;
}
</script>
</HEAD>
<BODY>
<form onSubmit="validate()" action="#">
<input type="text" id="phone"/>
<input type="submit" name="submit"/>
</form>
</BODY>
</HTML>