Answers for "javascript validate email form"

0

Email validation using javascript

function checkEmail() {

    var email = document.getElementById('txtEmail');
    var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

    if (!filter.test(email.value)) {
    alert('Please provide a valid email address');
    email.focus;
    return false;
 }
}

- Call the function on Email textbox
Posted by: Guest on May-07-2020

Code answers related to "javascript validate email form"

Code answers related to "Javascript"

Browse Popular Code Answers by Language