iFormBuilder JavaScript Tips & Tricks
How do I automatically start the Timer Element?
To automatically start the Timer element once the form opens, follow the instructions below.
STEP 1. Add the Timer Element to your form.
PLEASE NOTE: For more detailed instructions on adding the Timer element, please click HERE.
STEP 2. In the Dynamic Value of the Timer element, place the following value:
if (form_name.timer_widget == null) form_name.timer_widget = {}; form_name.timer_widget['isTimerActive'] = true; form_name.timer_widget;
PLEASE NOTE: form_name should be replaced with the table name of your form and timer_widget should be replaced with the data column name of your Timer element.
Want to start a timer widget on the subform level? It's similar to how subform aggregation works. Use this for single-paging subform element:
if (parent_form_name.subform_element[0].timer_widget == null) parent_form_name.subform_element[0].timer_widget = {}; parent_form_name.subform_element[0].timer_widget['isTimerActive'] = true; parent_form_name.subform_element[0].timer_widget;
Use this for multi-paging subform element:
if (parent_form_name.subform_element[parent_form_name.subform_element.index].timer_widget == null) parent_form_name.subform_element[parent_form_name.subform_element.index].timer_widget = {}; parent_form_name.subform_element[parent_form_name.subform_element.index].timer_widget['isTimerActive'] = true; parent_form_name.subform_element[parent_form_name.subform_element.index].timer_widget;
STEP 3. Test on your device. It should look similar to the following:
iForm Tip: Download the Form Package at the bottom for a sample form of this functionality.
Comments
0 comments
Please sign in to leave a comment.