Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Click the Finish button to save the work we have done.
  • On the Forms Home Page, click the Image Modified icon for the Employee Information form to continue editing.
  • Rules add behaviors to forms. We will add 4 rules to this form to accomplish the following:
    • The first rule will fill in the First and Last Name of the new employee and the name of the manager they report to, from the login information using the _data.getParameter.
    • The second rule will combine the employee's First Name and Intial and store it in the hidden field called FirstPlusInitial
    • The third rule will combine the City, State and Zip Code information and store it in the hidden field called FullAddress
    • The fourth rule will work with the GPS features on mobile devices detect the new employee's location information when they are filling in the Employee Information form.
  • Click on the Rules button on the designer toolbar to access the Rules Editor. Click the icon then the  icon to open the Rules validator screen. Give your rule a meaningful name: in this case we will call it Form Load. Copy/Paste the rule below into the rules canvas.

...

Code Block
if (form.positionUpdated) {
  var x = _data.getParameter ("position.street_number");
  Street.value = _data.getParameter ("position.street_number") + ' ' + _data.getParameter ("position.route");
  City.value = _data.getParameter ("position.locality");
  State.value = _data.getParameter ("position.administrative_area_level_1");
  ZipCode.value = _data.getParameter ("position.postal_code");
}

 

  • Refer to the Rule Validator for help in troubleshooting if there are any issues with the rules that we are adding to the form.
  • Click the Control button in the designer toolbar to return to the form. Your rules will be saved.
  • As a precaution, click the Finish button to preserve the work we have done so far.

13. Drag and drop a PageBreak control below the manager control. Click on the PageBreak control and notice the property pane shows both phone and tablet checked. This is the default value and we will leave it as is. This will ensure that the controls above the PageBreak will appear on the first page when the form is rendered on the iPad or the iPhone. You may have to drop the PageBreak control onto the canvas and then move the image, Date of Birth and Your Manager controls above it. Drag another PageBreak control below this panel. Check phone and uncheck tablet on the PageBreak property panel. At this point, your form should look similar to the image below:

...