For the first time ever I had two users come into my app with a .education top level domain. Their email address looked like this: [email protected]. I'm using the cfinput validate attribute on the form they are filling out as follows:
<cfinput type="text" name="email" required="yes" message="Please enter a valid email address." validate="email">
When the users submits the form they are getting my error message. The form has been working successfully for years on all the other email addresses entered. Are there any tricks to make it take this top level domain? TIA
I agree with the other answers about limiting your use of cfinput, but as a quick fix you should be able to use the cfinput PATTERN attribute (https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-i/cfinput.html):
<cfinput type="text" name="email" required="yes" message="Please enter a valid email address." validate="regex" pattern="(?:[a-z0-9!##$%&'+/=?^_
{|}~-]+(?:\.[a-z0-9!##$%&'*+/=?^_
{|}~-]+)|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\[\x01-\x09\x0b\x0c\x0e-\x7f])")@(?:(?:a-z0-9?.)+a-z0-9?|[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-][a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\[\x01-\x09\x0b\x0c\x0e-\x7f])+)])">The PATTERN attribute can be changed to any regular expression. The one provided is RFC 5322 compliant.
EDIT: Changed pattern to Java based RegEx and escaped #'s