2011-09-14
 
Kategorie
 

Value Actions: Automatic Field Value Calculation

 

While creating a form in ActiveForms, you can create a list of actions that will automatically change the value of each field. The actions can:

  • clear the field,
  • set a given value,
  • reset the field value to a default setting,
  • set a value copied from another field.

Specify a condition for each action:

You can create an unlimited number of such actions. A field can assume value ‘A’ under condition ‘X’, value ‘B’ under condition ‘Y’, get cleared under condition ‘Z’, and so on.

The ActiveForms dependency engine checks consecutive action conditions for a field. If it is determined that a condition has changed its value, an action is executed (a value is set or cleared). Actions from the list are executed until the first one succeeds, i.e. if the engine finds a condition that has changed its value, the corresponding action is performed and the remaining actions are ignored in this run.

Optionally, you can specify an action at the end of the list which will be executed if no condition specified above occurs.

Actions are executed only when the corresponding condition has changed its result. If you build an action with the ‘Field A is not empty’ condition, the action will be performed when a value is entered in the empty field A (more specifically, when the user leaves the field). However, if field A had a value already, a change to the value will not trigger an action (because the field was not empty before and is not empty now, so the result of the condition has not changed).

Value change actions are independent of field hiding and disabling actions. Note that hiding a field in certain situations doesn’t mean it will be automatically cleared. Clearing actions are created separately, regardless of when the field is visible or hidden.

Finally, a few comments about copying values from one field to another. First, you can only copy values between similar fields. You can’t copy values from a Single Line Text to a Radiobutton field or from a Multiline text to a date field. Second, if you want to copy a value from a selection field (a Drop-down list, a Radiobutton) to an open field (Single Line Text, Multiline text, Hidden), you can choose whether to copy the option value or the label.

So much for theory. Stay tuned for more about possible applications.

 
 
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!