Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<html>
<head>
<script language="JavaScript">
<script>
function validatePhone(phonenumber) {
var rephonenumber = /^(?:\([2-9]\d{2}\)\ ?|[2-9]\d{2}(?:\-|\ ?))[2-9]\d{2}-\d{4}$/;
return rephonenumber.test(phonenumber);
}
function validateForm()
{
// Validate Phone
var phonenumber = $("#phone").val();
if (validatePhone(phonenumber)) { } else {
alert("Please enter a valid phone number, format ###-###-####");
exit();
}
return false;
}
</script>
</head>
<form method="post" onsubmit="return validateForm();">
Phone Number: <input type="text" name="phonenumber" id="phone" placeholder="###-###-####"/><br />
<input type="submit" name="Submit" value="Submit" />
</form>
<!DOCTYPE HTML>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script language="JavaScript">
function validatePhone(phonenumber) {
var rephonenumber = /^(?:\([2-9]\d{2}\)\ ?|[2-9]\d{2}(?:\-|\ ?))[2-9]\d{2}-\d{4}$/;
return rephonenumber.test(phonenumber);
}
function validateForm(){
// Validate Phone
if (validatePhone( $("#phone").val())) {
return true;
} else {
alert("Please enter a valid phone number, format ###-###-####");
return false;
}
}
</script>
</head>
<body>
<form method="post" action="" onsubmit="return validateForm();">
Phone Number: <input type="text" name="phonenumber" id="phone" placeholder="###-###-####"/><br />
<input type="submit" name="Submit" value="Submit" />
</form>
</body>
</html>
<!DOCTYPE HTML>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script language="JavaScript">
function validatePhone(phonenumber) {
var rephonenumber = /^(?:\([2-9]\d{2}\)\ ?|[2-9]\d{2}(?:\-|\ ?))[2-9]\d{2}-\d{4}$/;
return rephonenumber.test(phonenumber);
}
$(document).ready(function(){
$('#phoneForm').on('submit', function(e){
if(validatePhone( $('#phone').val() ) ){
return true;
} else {
e.preventDefault();
alert("Please enter a valid phone number, format ###-###-####");
}
});
});
</script>
</head>
<body>
<form method="post" action="" id="phoneForm">
Phone Number: <input type="text" name="phonenumber" id="phone" placeholder="###-###-####"/><br />
<input type="submit" name="Submit" value="Submit" />
</form>
</body>
</html>