s
Contact Login Register
h M

Dynamic Forms Demo 11

 

Please select a category from the dropdown list and notice that values for the next 2 fields change based on prior selections.


Save           

Behind the Demo

This demonstration illustrates the ability to create dependent, data driven dropdown menus. This functionality allows the user to select a category from a dropdown menu, which when selected, populates another subcategory dropdown menu with the subcategories of the selected category. When the user selects a subcategory, this then populates a checkbox list with all the products associated with the selected subcategory.

In order to implement this functionality we will do the following:

Create the Questions

1) Create the "Category" question and set the following properties:


  • Give it the name "Category"

  • Give it the shortname "Category"

  • Set the "Question Type" to "Combo Box"

  • Select "SQL Driven Options" under "Question Options"

  • Enter your SQL statement that will be used to fill the combo box

2) Create the "Subcategory" question and set the following properties:


  • Give it the name "Subcategory"

  • Give it the shortname "Subcat"

  • Set the "Question Type" to "Combo Box"

  • Select "SQL Driven Options" under "Question Options"

  • Enter your SQL statement that will be used to fill the combo box, making sure the "WHERE" clause looks like this, "WHERE fieldName = $(Category)"

  • Under "Advanced Field Options" check the "Hide until forced visible by question event" checkbox. This will ensure the "Subcategory" dropdown is hidden until the user selects a value from the "Category" dropdown.

3) Create the "Product" question and set the following properties:


  • Give it the name "Products"

  • Give it the shortname "Products"

  • Set the "Question Type" to "Checkbox Group"

  • Select "SQL Driven Options" under "Question Options"

  • Enter your SQL statement that will be used to fill the combo box, making sure the "WHERE" clause looks like this, "WHERE fieldName = $(Subcat)"

  • Under "Advanced Field Options" check the "Hide until forced visible by question event" checkbox. This will ensure the "Products" checkbox group is hidden until the user selects a value from the "Subcategory" dropdown.

 

Create the Question Events

1) Create a new question event that will execute when the user selects a "Category" and set the following properties:

  • Call the event "SelectCategory"
  • Select "Display hidden question based on another questions response" under the "Event Type"
  • Select "Category" from the "initiation/postback question dropdown menu
  • Check the "Execute event for any response" checkbox
  • Check the "Subcategory" checkbox next to "Affected Question"

2) Create a new question event that will execute when the user selects the "Subcategory" and set the following properties:

  • Call the event "SelectSubcategory"
  • Select "Display hidden question based on another questions response" under the "Event Type"
  • Select "Subcategory" from the "initiation/postback question dropdown menu
  • Check the "Execute event for any response" checkbox
  • Check the "Products" checkbox next to "Affected Question"

When it's all setup and working properly it should behave like the demonstration above.



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