Email validation in "form" entry | XM Community
Skip to main content
Hi -

Sorry if this is elsewhere.



I'm getting some respondents emailing me to say that the survey isn't accepting their @gmail email addresses.



I'm asking for emails via the "form" format question. Then in the option tabs for the email line, I had selected "Validation: Valid email address". This is an option *within* the question, and I hadn't set any validation on the toolbar on the right (outside the question in the survey builder, if that makes sense).



Is there any reason why these settings would prevent particular domain names being accepted? For now I've turned off validation on this line until I find a fix.



Thank you 🙂
@EmmaAC for example we have not had any issues with certain domains, however, we have had issues if a person copied & pasted their email into the form, an error was shown. It was caused by the fact that when copied, some email addresses included a space before or after the email address.
Aha. Could it be that a similar thing happens with "autocomplete" on smart phones?
Unfortunately, this i don't know, no one has mentioned autocomplete in our case at least
Thank you 🙂

I think I'll leave it unvalidated for now, just in case!
You can remove leading and trailing spaces from text input fields using JS:

```

jQuery("#"+this.questionId+" input[type=text],textarea").on('blur', function(e) {

this.value = this.value.trim();

});

```
@TomG oh, this is really good thing to know, i didn't even think about JS

Leave a Reply