Jump to content

Email Validation


Recommended Posts

  • 3 weeks later...
On 10/12/2017 at 12:54 AM, Bruins said:

How do I validate an email address like rkazunaga@mednet.ucla.edu validating the @mednet.ucla.edu on a submission form.

I modified a solution from this post for submission form. You may try using my script in the footer: 

<script>

function validateEmail(email)
{
var email =  document.getElementById("InsertRecordEmail_field").value;
    var splitted = email.match("^(.+)@thisdomainonly\.com$");
    if (splitted == null) 
return false;

    if (splitted[1] != null)
    {
        var regexp_user = /^\"?[\w-_\.]*\"?$/;
        if (splitted[1].match(regexp_user) == null) 
return false;
        return true;
    }

    return false;

}

 document.getElementById("caspioform").onsubmit=validateEmail;
</script>

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...