2011-08-25
 
Kategorie
 

Dynamic Option Lists

 

For Drop-down list, Radiobutton list, Checkbox list and Multichoice fields, the form developer specifies option lists. Sometimes, we don’t want all options to be available all the time. ActiveForms allows you to change option lists dynamically, in accordance with to data entered by a user in the form.

The option table for a field includes two columns: Initial state and Action:

Initial state specifies whether the option is initially (when presenting the form) visible and active. Action tells us when this state is to change.

By default, all options of all fields are visible and active. However, when building a logical condition, you can decide when an option should be hidden or disabled. For example, you can restrict a list of available credit cards depending on income specified by a user:

You can build conditions in both directions, i.e. you can specify:

  • that an option is visible by default, but should be hidden under a certain condition;
  • that an option is hidden by default, but should be shown under a certain condition.

An option can be visible and active depending on values entered in other fields, but you are free to base those conditions on hidden fields whose values will be passed via an URL or the API. This way, using form calling parameters, you can influence options that should be displayed to a specific user.

This mechanism works perfectly when the number of dynamically enabled options is not very large. If you want to build long and very variable option lists, consider generating options by external services.

 
 
recent posts
3rd Apr 2014
Faster than ever!
5th Dec 2013
Live validation!
2nd Dec 2013
Features distilled
12th Mar 2012
Flicking Channels
26th Jan 2012
Your Own Error Page
9th May 2011
Box Properties
15th Apr 2011
Grouping Fields
13th Apr 2011
Form Versioning
24th Feb 2011
Form Access Modes
22nd Feb 2011
Required Fields
4th Feb 2011
Stats!