Form Builder Common Questions
Table of Contents
WHAT IS PAGE LEVEL JAVASCRIPT?
Page Level JavaScript loads user-defined global variables and functions that can be called by a parent form and/or any of the related child forms.
How do I add Page Level JavaScript to my form?
To add Page Level JavaScript to your form, please follow the instructions below.
PLEASE NOTE: In the below example we'll show how to define a variable called myname that has been assigned a value of Craig .
STEP 1. With your form pulled up in the Form Builder, click the Page Level JavaScript icon.
STEP 2. On the next page, add your Page Level JavaScript.
var myname='Craig';
STEP 3. Click Save.
STEP 4. In the Dynamic Value field of the element, you wish to populate with Page Level JavaScript, add the variable you created. In this example it is myname.
This variable can be used over and over again throughout your form and/or subforms.
STEP 5. Save your form.
Step 6. Test it out on your device or Webforms.
iFORM TIP: Any functions or variables placed on a "subform" will not be available for use. Please place everything on the parent level.
Scoring Example
Attached is a form package that'll show you an example of defining javascript functions in the page level and calling them in dynamic values. The form name is "safety_checklist": when you select Safe or At Risk or N/A in the select fields, the score will update real time in the total counts.
Comments
0 comments
Please sign in to leave a comment.