starting learning java html programming and need a bit of help for data validation in html forms.
Can anybody help out on the email pattern and the phone number data validation pls? Thanks heaps
// validating email pattern with @gmail.com
if (email.value.indexOf("@", 0) < 0) {
window.alert("Please enter a valid e-mail address.")
email.focus();
return false;
}
//validating phone number
if (phone.value =="//needs to be numbers only" ) {
window.alert("Please enter a valid phone number.")
phone.focus();
return false; }
Any assistance with email pattern and number validation would be great.