Ways to Access Dynaform Controls

Responsive Dynaforms in ProcessMaker 3.2 and the libraries they are based upon (jQuery, Backbone and Bootstrap) provide custom methods to interact with Dynaform controls. To use a ProcessMaker method to manipulate a control, first obtain the object for the control using either a jQuery selector or one of ProcessMaker's custom functions, such as getFieldById(), which are listed below. It is recommended to use ProcessMaker's custom methods to manipulate the controls when possible, because they have built-in error checking when setting the value of fields and are generally easier to use.

Programmers who are more comfortable using standard JavaScript rather than jQuery may wish to access controls using their Document Object Model (DOM) objects, which provide the standard methods. Take into account that these methods are not officially supported, and their use may cause issues when working on ProcessMaker Mobile.

Parts of a Control

ProcessMaker's custom methods refer to 3 parts of a control:

  • The label is the text displayed to the left of or above the control to describe the purpose of the control to the user.
  • The text is what is displayed to the user in an input field. For textboxes and textareas, the text is the same as the value, but other types of input fields, such as dropdown boxes, checkboxes and radio buttons, have a separate displayed text and a stored value (key) for each option.
  • The value is what is entered into an input field and saved when the Dynaform is submitted. The value is the same as the text in fields such as textboxes and textareas, but it is different in fields that have selectable options, such as dropdown boxes, checkboxes and radio buttons, where the visible text is different from the internal value (key) that represents an option.