Value Rules

Last updated Jan 29 2018
What are value rules?
Value rules are principles you define regarding what data may be entered in a field and what data may not.
An example of a value rule is defining that the number entered in the "Age" field is greater than 18.  In this case, if the form filler will enter "17", an error indicator will appear beneath the element saying the age must be greater than 18, and the form filler will not be able to submit the form until a the value complies with the field rule.

Following are steps to add a value rule to your fields:

1- Enter your form in the form builder
2- Select the field you would like to add a rule to (in the image below the name field is chosen)
3- Go to "Properties" panel > "Element" tab > "Value Rule" category


Press on the "Set Value Rules" button

Configure your rule: Choose the relevant option from the dropdown. The options include simple rules like "Contains", "Not Contains", "Starts with", "Max length" etc.
They also contain ready-made rules that do not require you to set a value. like: Israel ID or US SSN.
You can also choose the REGEX option and enter an expression, like :  /^[a-zA-Z]*$/  -  to have the user fill in only Alphabetic characters.
Read more about validation with REGEX

For full control on validation you can use the custom option to use javascript validation. For example, the following code will validate IBAN account numbers from the UK:

var fieldData = fieldValues.fld3.toUpperCase();
var data = fieldData.replace(/^(.{4})(.*)$/,"$2$1"); //Move the first 4 chars from left to the right
data = data.replace(/[A-Z]/g,function($e){return $e.charCodeAt(0) - 'A'.charCodeAt(0) + 10}); //Convert A-Z to 10-25
var $sum = 0;
var $ei = 1; //First exponent
for(var $i = data.length - 1; $i >= 0; $i--){
$sum += $ei * parseInt(data.charAt($i),10); //multiply the digit by it's exponent
$ei = ($ei * 10) % 97; //compute next base 10 exponent in modulus 97
if($sum % 97 != 1) {
return false;

isValid = /^GB\d{2}[A-Z]{4}\d{14}$/i.test(fieldData)

Another example: in the image below you can see that the rule states the "name" field must contain "John".
Setting this rule will not allow the form filler to submit the form unless the "Name" field consists of "John".


You can also create a more complex rule by using a few conditions and brackets. Of course once rules get more complicated it may seem hard at times to review them - this is why we have also added the "Show friendly condition" link here.
Pressing on this link will show you the condition you created in a clear format.


Once you configure your desired value rule these terms will be added to the field and the form filler will e required to abide by them. If, for example you set that your field "Not Contain" "Benny" - 
this means that if the user enters "Benny" in this field an error message will appear stating : Should not contain 'Benny'.
These error messages are by default automatic and based on your value rule, however you can set a custom message instead if you like in the "Custom error message" textarea below.

CommentsLogin Required
Didn’t find what you were looking for?
Try the following for assistance or Use the Search box.