I've discovered a better way of validating email than using regular expressions. There is now a special feature in Dojo specifically for emails.
Remove the "regexp" attribute from the HTML for the email element and replace with the following:
regExpGen="dojox.regexp.emailAddress"
For this to work, you'll also need to add the following code to the top of the page.
dojo.require("dojox.validate.regexp");
This is using the dojox module which I've tried to avoid in the book but hopefully this feature will work its way into the dojo module soon!
Comments