zerion

Scroll
Follow

Client Validation

SMART CONTROLS

WHAT'S COVERED IN THIS ARTICLE?

WHAT ARE SMART CONTROLS?

Smart controls use JavaScript to add various functions to forms as shown below.  They can be used to hide elements, perform skip logic, change data and more.

Client-Validation-Step-1.png 

Click here for more information on smart controls.


WHAT IS CLIENT VALIDATION?

Client Validation allows...

  • Form builders to prevent illegitimate data to be uploaded to the server.
  • Form builders to set multiple validation criteria on an element.

The client validation value must be true for a particular element to pass validation. This smart control is located on the Element Properties menu (on the right-hand side in form builder).


What is a Validation Message?

The Validation Message helps...

  • instruct data collectors as to where the error in their data lies.
  • enforce complex criteria within your form.

How do I Add Client Validation to an element?

To add Client Validation to your element, please follow the instruction below.

Example: Teachers have to enter students' test results on a form and the score ranges from 0 to 100.

STEP 1

Highlight the element you want to add the Client Validation to.  In this example, we will be working with a Number element.

Create-CV-Step-1.png

STEP 2

On the right-hand menu, scroll down to the Smart Control section.

Create-CV-Step-2.png

Step 3

In the Client Validation field, enter the following: test_results >= 0 && test_results <= 100.  This indicates that the number entered by the user must be greater than or equal to 0 and less than or equal to 100.

Tips: Use || for or and && for and

Create-CV-Step-3-v2.png

Step 4

In the Validation Message field, enter the message you want the user to see if the validation is not true.  For example: "Please enter a number between 0 and 100"

PLEASE NOTE: Validation messages MUST be wrapped in quotation marks in order to display on the device correctly.

Create-CV-Step-4.png

Step 5

Test it out on your device.  If a user enters a number that is not in the range from 0 to 100, the Validation Message will be shown upon submitting the record.

validation message screen shot
Download the form package below for an example on how to create Client Validation.

    Was this article helpful?
    0 out of 0 found this helpful
    Have more questions? Submit a request

Comments

Powered by Zendesk