Validating text box

Test your regular expressions: Reg Ex Tester A Reg Ex library to search other commonly used patterns: Reg Ex Lib Reg Ex Cheat Sheet: Cheat Sheet Let's say you asked for respondents' email addresses in a survey.

Let's also assume that you wanted to ask only respondents who have Gmail accounts a follow-up question.

In the example below, you can see the input type URL inside this Textbox question, validating the response to ensure a URL is entered. Google Chrome is the most compatible with HTML5, but Firefox is a close second.

If you'd like to see what your particular browser can support, please visit HTML5 Test.

A good place for this is the additional instructions section of your question title.

To add example formatting, edit your question and click the link to Add Additional Instructions.

Now you can explore these areas and comment here in case of any issues.

When using Textbox questions, often times you'll want to validate the data your respondents enter.

validating text box-88validating text box-52validating text box-51

Finally, input the following Reg Ex code into the third text field to complete the logic: [^ ]*@gmail\.com$This will show our follow-up question only if the email collected ends in "@gmail.com".With a little extra effort, you can create much more complicated validation patterns on your own!As you initially create a Textbox question, you are given the option to choose from Number, Email, Percent and Date (either MM/DD/YYYY or DD/MM/YYYY) as the type of validation.Listing 3: Validation for all letters Figure 3: Above output checks the entered data is letters or include any other char also. Two of them are using regular expression for matching and the other one is simple so not writing regex but if you want you can write a regex for this case also.There are various validation schemes for checking the other type of validations, like check for all or no, checking for all letters and numbers and restricting the length of field.

Leave a Reply