I have used jQuery validate to validate email addresses but while testing it accepts email addresses like ak@cmmmm.c or ak@gh.com.com which should not be accepted. So can I edit jquery.validate.js and insert my own regex. If any better solution please help me.
Thanks, any help from you is valuable for me.
For sure you can:
As far as I understood this is your jquery.validate.js plugin.
http://code.google.com/p/jqueryjs/source/browse/trunk/plugins/validate/jquery.validate.js?r=6243
In the line 964 you have your function that validates email:
Just substitute that huge line, with the expression you want to and this will be ok.
Here is an example of regex for email:
Validate email address in JavaScript?
I do not want to through to you my validator, because I have no idea what exactly do you need as a right one.
But keep in mind there is no way that you will be sure that the email the person entered is a correct one. justforfun@gmail.com will pass all validators, but how can you be sure that it is a valid user’s email.
If a person will be truly interested in providing a right email – he will check a dozen of times (never seen nice validators on any embassy web-site)