I am using the jquery validate function and plugin located here.
http://docs.jquery.com/Plugins/Validation
I am going thrue the js file and i have found the email validation block that makes sure it is a valid email, the thing is, i want to only allow .edu emails. I have no idea where to start.
You don’t need custom extension. You can use
accept()method: http://docs.jquery.com/Plugins/Validation/Methods/accept#extensionFull example: http://jsfiddle.net/M5TmU/2/ (based on Brombomb’s jsfiddle)
UPDATE
After xecute’s comment – you may use custom regex pattern. In
additional-methods.jsyou have “pattern” method (last one in a file):Full example: http://jsfiddle.net/M5TmU/3/
Of course it’s not perfect, but still – you don’t need write custom method 🙂
ADDITIONAL EDIT: country domain names have two letters, so
\w\w\w?is too much –\w\wshould do. I left\w\w\w?in fiddle