I have a site that will require a login by the users. The client will only only users from their company’s domain to gain access. I need to validate the field based on an e-mail domain address. ie. only allow email addresses from @mycompany.com to go through.
Can this be done with the jquery.validate plugin? I see where you can check to see if it’s a valid e-mail, but I’d like to make sure it matches a specific pattern (@mycompany.com).
Any help would be appreciated!
Simply use the jQuery validate, and do a string comparison to check that the email ends with the expected domain.
That way you know the email appears valid, and is of the required domain.
Here’s a possible method of checking the domain. This doesn’t actually require jQuery.