Improve Email Validation in Qualtrics Forms

I received a Qualtrics form submission where the email field, which is supposed to be required, was left blank. The customer then forwarded me the address she tried and said the form kept saying it was invalid. Since the address she sent was indeed valid, I needed to look into what was potentially causing the error. I also needed to determine how the form was submitted without an email address.

Background

The email field was added as a block of fields. The field type is under Text Entry > Form (see Figure 1).

Qualtrics screenshot showing the Form option for the Text Entry question type
Figure 1. Form Option for Text Entry Questions

To help prevent bogus addresses, I clicked the "click here to edit form fields" link and set the email field's validation to Valid Email Address (see Figure 2).

Qualtrics screenshot showing the option to validate email addresses
Figure 2. Valid Email Address Option

I also used Custom Validation to make sure the email, name, and a couple other fields cannot be empty (see Figure 3).

Qualtrics screenshot showing that all fields are required
Figure 3. All Fields Are Required

What Happened?

The good news is that the form does prevent the email from being blank. However, it does nothing to prevent a space character from being considered a valid email address.

That got me thinking about leading and trailing spaces. The common practice is to pass the text through a trim function to remove leading/trailing spaces that are accidentally entered by the user. It turns out that spaces are not removed and will cause the invalid email error.

Solution

To prevent the form from accepting a space character as a valid email address, I updated the Custom Validation shown earlier. In addition to being required, the email address cannot contain a space character (see Figure 4).

Qualtrics screenshot showing how to prevent emails with spaces from being accepted
Figure 4. Custom Validation to Detect Spaces

Note that I typed the " " (space) character in the text box to the right of the "Does Not Contain" drop down.

Since the space character can be difficult to see, I also wanted to let users know when they accidentally include one. So I added a new "Descriptive Text" question which uses Display Logic. The new question is set to only display when a space is detected (see Figure 5).

Qualtrics screenshot showing the Display Logic for space character message
Figure 5. Display Logic to Detect Spaces

0 Comments

There are currently no comments.

Leave a Comment