This demonstration illustrates the use of regular expressions and question events. Below is a breakdown of each field and how it is set up.
1) First Name - regular text box, required field.
2) Last Name - regular text box, required field.
3) Email - required field. We used a regular expression that forces the user to enter an email that is standard format. Regular expression used: ^[_a-zA-Z0-9-] (\.[_a-zA-Z0-9-] )*@[a-zA-Z0-9-] (\.[a-zA-Z0-9-] )*\.(([0-9]{1,3})|([a-zA-Z]{2,3})|(aero|coop|info|museum|name))$
4) Phone Number - we uses a regular expression for the phone number that forces the number to be entered in the following way: ###-###-####. If the user enters letters or does not enter dashes between area code and suffix, they will be asked to enter in a valid entry. This is not a required field, as those users who live outside of the United States are asked to skip this question. We also used a Text Header on the phone number text box that instructs the user what the valid format is. Regular expression used: \(?\d{3}[-.]\)? ?\d{3}[-.]\d{4}
5) Mailing address - regular text box, required field.
6) In which country do you live - SQL Driven Options, required field.
- If user chooses United States, next option is to choose a US state. Drop down combo box for US state is done through SQL Driven Options.
- If user chooses Canada, next option is to choose a Canadian Province. Drop down combo box for Canadian Province is done through SQL Driven Options.
- If user chooses Mexico, next option is to choose a Mexican state. Drop down combo box for Mexican state was manually entered. ***Note: not all Mexican states are listed.
If user chooses any country other than the three listed above, the next question asks user to manually type in the region. This is a regular text box.