s
Contact Login Register
h M

Dynamic Forms Demo 1






Please use ###-###-#### format. 



Select Belgium, Canada or United States
and notice the different fields displayed.


 

Save           

Behind the demo

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 use 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) The country field is populated by SQL Driven Options.  Here's what we used for this demo:

Select '– Select Country –' as QuestionOption, ' – Select Country –' as QuestionOptionValue
Union
select Text as QuestionOption, Text as QuestionOptionValue from Lists where ListName= 'country' order by QuestionOption
select Text as QuestionOption, Text as QuestionOptionValue from Lists where ListName= 'country' order by text

  • 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 using this:
Select '– Select State –' as QuestionOption, ' – Select State –' as QuestionOptionValue
Union
select Text as QuestionOption, Text as QuestionOptionValue from Lists where ListName= 'Region' and parentid=221

  • Similar statements have been used to pull Provinces if user chooses Canada.


See other Form Demos.

DOWNLOAD A COPY


tip6.gifWould you like to set up your form just like this demo? 

     Simply download this template and save it using the exact file name (don't rename).  Next, upload it to File Manager and then go back to Dynamic Forms and click on Import Content.   

Get a copy now!



Let us do it for you



    Need help?  

Our super powers can make it happen. 

Let's start talking.




Enter your email below AND grab your spot in our big giveaway!

The winner will receive the entire Data Springs Collection 7.0 - Designed to get your website up and running like a DNN superhero (spandex not included).

  
Subscribe