Versions Compared

Key

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

...

The designer can also display a message instructing the user what to do. This method is very helpful to users when trying to determine why a form does not submit. Refer to this topic for the details.

Troubleshooting Hidden Required Fields

Sometimes you'll test your form and see that the form will not submit even when all required fields appear to be filled with valid data. The cause is always a hidden required field with no data or a hidden field with invalid data. Since the field is hidden your users won't be able to enter a value into that required field nor to correct an invalid value in that field and will therefore never be able to submit your form. In a simple form it won't be hard for you to open it in the form designer, find the hidden required field and fix the problem. In a large form or one that has dynamic business logic that makes fields hidden/visible or required/optional or sets values in business rules, you'll need to debug this problem while testing the form.

Step 1

The first step to solving this issue is to understand which control(s) are causing this issue. There are two ways to find the invalid controls:

Method 1

  1. Install your browser's developer toolTest your form and enable the developer tool. This tool is a great way to find hidden controls which are invalid or required and empty.
  2. Test your form and enable the developer tool.
  3. You can access it by right clicking on a page and selecting Inspect, or by using the keyboard shortcuts indicated for your OS/Browser. The following links point to documentation on developer tools for several supported browsers.
    1. Chrome
    2. Firefox
    3. Safari (Web Inspector)
  4. Open the developer tool's HTML tab and search for all instances of s-invalid using the search box in the tool's top-right corner. This will take you to the HTML of each control in the invalid state. The control's name can be found in that HTML.
  5. Now you can edit your form in the designer, find that control and fix the issue.

Note

If a required control is inside a hidden section, then that section will also be invalid and you will also see s-invalid in the section control's HTML. This s-invalid is not the root cause of your bug. You will have to continue searching with developer tools further to get to the actual control inside the section control that is the root cause.

Method 2

...

  1. Test your form and enable the developer tool.
  2. Click on the Console tab.
  3. Execute this JavaScript function _frevvo.api.forms.controls.getControlErrors(); Calling this function returns a collection of objects that describe any invalid controls including the control id, control label and the error description. In the image, you can see the reported errors for an Email, Money and Date field that contain invalid data. The controls are inside of a hidden section and are not visible to the user who is trying to Submit/Continue the form/workflow.

Step 2

Once you know which control(s) are causing the problem, you can resolve it.

  • Check your business rules to make sure they are setting those controls' required property correctly. Use the View All feature to quickly search for business rules affecting the control(s) you identified above.
  • Test the form and use the Debug Console to determine what value is being set that might cause a control to become invalid. Pay particular attention to leading or trailing spaces. Certain controls that require a pattern (email, phone, etc.) must be set to null (not an empty string such as '') in order to be valid when their value is cleared via a business rule. The Visual Rule Builder will handle this correctly.
  • Check the control's default settings. For example, a required section that contains a default value in one control will set all other required controls inside the section to "required" at run-time. Uncheck the section's required property by default, or set your default values at run-time using a business rule.

Re-test the form to determine if your changes resolved the issue. 

Testing Form/Workflow Customizations

Test your form to verify that all your business rules are working as expected. For instance if you have a radio field "Billing address same as Shipping?" and select "no", you would expect the hidden Shipping Address section to become visible and required. Test each form field that has dynamic business rules to verify that they are working as you want. Also remember to test the negative cases, for example if you then click "yes" to the billing address question, make sure the Shipping Address section control becomes hidden and optional again. Note it's very important that hidden controls are not required as discussed above.

...