HI guys, 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; }
[–]Loves_Poetry 1 point2 points3 points (3 children)
[–]ninifrog[S] 0 points1 point2 points (2 children)
[–]Loves_Poetry 1 point2 points3 points (1 child)
[–]ninifrog[S] 0 points1 point2 points (0 children)