i want to put another condition where mobile No. should contain 8 digits only starting with 5. (ex:52024050). any help
function formValidation() {
var mobile = document.forms["form"]["mobile"].value;
// red expression
var checkNumbers = /^[0-9 ]+$/;
if (mobile == null || mobile == "") {
error[error.length] = ("Enter your mobile number");
document.form.mobile.focus();
$(document.forms["form"]["mobile"]).css("background-color", "blue");;
} else if (mobile != null || mobile != "") {
if (!checkNumbers.test(mobile)) {
error[error.length] = ("Enter Only numeric Characters for mobile phone");
document.form.mobile.focus();
$(document.forms["form"]["mobile"]).css("background-color", "blue");
}
<form name="form" onsubmit="return formValidation()" action="process.html">
Mobile phone:     
<input type="text" name="mobile" id="mobile">
<input id="submit" type="submit" name="submit" id="submit">