Once a person has entered his/her email address in a textbox, how do I validate that it's in a proper email format, e.g. email@example.com?
The manual says that I can set the textbox type to 'email':
But how do I validate it, and if it's non-email format, then how do I return an error?
EDIT June 4, 2012 - I've figured it out.
You can use the system expression - tokencount.
From the manual:
Count how many tokens occur in src using separator. For example, tokencount("apples|oranges|bananas", "|") returns 3."
I did tokencount("firstname.lastname@example.org", "@") to check for the number of 's (there should only be one).
Then did the same for "."'s.
Regular expressions would have been better, but this kind of works.