Versions Compared

Key

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

One of ' most powerful and useful features is its ability to automatically ensure that any submitted form generates a set of XML documents that are valid with respect to their corresponding XML schemas. does this by:

Column
width240px

 On this page:

Table of Contents
maxLevel1

...

Form fields added from ' control palette have built-in validation rules.  The table below details the default validation for each control type in ' palette. Patterns added to a control change the defaults.

Control TypeDefault Validation Rule
Textxsd:string
Text Areaxsd:string
Datexsd:date
Emailxsd:string with pattern [a-zA-Z0-9\-_][a-zA-Z0-9\-\+_]*(\.[a-zA-Z0-9\-\+_]+)*@([a-zA-Z0-9\-_]+\.)+[a-zA-Z]{2,6}
Moneyxsd:double
Phonexxxxxxxxxx, xxx-yyy, xxx.yyyy, xxx-yyyyzzzz, xxx.yyy.zzzz,
Timexsd:time
Quantityxsd:decimal with pattern [\-+]?[0-9]+
Numberxsd:double
T/Fxsd:boolean

If a user clicks submit and any of the controls listed above fails validation, the controls will be highlighted with an orange color indicating that the form cannot be submitted. See above for other methods to notify users when forms are invalid.

...

If a user enters a value in a field that does not match the required pattern, a validation error displays when the user tabs out of the field. If the user clicks Submit without correcting the invalid data, then the field will be highlighted with a background color and submission will not be allowed. See above for other methods to notify users when forms are invalid.

...

This pattern allows you to specify the number of decimal places for Number Controls. Change the number 6 in the pattern to the desired number of decimal places. Note there is a period before the second slash.

Code Block
\d+(\.\d{1,6})?

An customized error message displays if the user enters more than the allowed number of decimal places and the control becomes invalid.

...

If you use  In-house (downloaded and installed on your computer), you can change ' built-in patterns for the Email control by editing the ''types.xsd'' file included in the <frevvo installdir>/tomcat/webapps/frevvo.war file. This file includes the email type definition shown below, and you can edit its pattern value. See the example in the phone pattern section below for instructions to modify the types.xsd file.

Code Block
<xsd:simpleType name="emailType">       
          <xsd:restriction base="xsd:string">        
                  <xsd:pattern value="[a-zA-Z0-9\-_][a-zA-Z0-9\-\+_]*(\.[a-zA-Z0-9\-\+_]+)*@([a-zA-Z0-9\-_]+\.)+[a-zA-Z]{2,6}"/>         
          </xsd:restriction>    
</xsd:simpleType>

Phone pattern

...

You can also create a custom email pattern on Text control. This would be useful to ensure users only enter their work or school email, for example. Drag a text control from the palette and set the pattern as follows, replacing "@domain.com" with your domain.

Code Block
[a-zA-Z0-9\-_][a-zA-Z0-9\-\+_]*(\.[a-zA-Z0-9\-\+_]+)*@domain.com

Phone pattern

Lets say you would like to change the phone control validation from the ' current built-in pattern. Cloud customers must apply Patterns to a text control while in-house customers have two options

  1. Apply patterns to a control - Like other control properties, the pattern property will not need to be redone when you upgrade .
  2. Modify the built-in values in the types.xsd file. Be aware that if you modify the types.xsd file, you will have to make this change each time you perform a  upgrade or apply a  patch.

...

If you are using  Online, you will not have access to types.xsd. Both cloud and in-house customers, can override the pattern in the phone control by setting its pattern property. You can only restrict a built-in pattern (such as the phone control) but not change the pattern via the pattern property. For example you can add the pattern 203-\d{3}-\d{4}.  Now all phone numbers must start with area code 203.

Tip

The Pattern property will not need to be redone when you upgrade .

A pattern such as ##-####-#### or ####-###-### is not a simple restriction. To impose validation against this pattern you must start with a Text control rather than a Phone control

...

  1. Apply patterns to a control - Like other control properties, the pattern property will not need to be redone when you upgrade .
  2. Modify the built-in values in the types.xsd file. Be aware that if you modify the types.xsd file, you will have to make this change each time you perform a  upgrade or apply a  patch.

...

If you are using  Online, you will not have access to types.xsd. Both cloud and in-house customers, can override the pattern in the phone control by setting its pattern property. You can only restrict a built-in pattern (such as the phone control) but not change the pattern via the pattern property. For example you can add the pattern 203-\d{3}-\d{4}.  Now all phone numbers must start with area code 203.

Tip

The Pattern property will not need to be redone when you upgrade .

A pattern such as ##-####-#### or ####-###-### is not a simple restriction. To impose validation against this pattern you must start with a Text control rather than a Phone control

...

Modify the types.xsd file

frevvo OEM partners may choose this method when customizing .  The built-in values are shown in the image below:

...

If you are using  In-house (downloaded and installed on your computer), you can change ' built-in patterns for the Phone control by:

  1. Stop  if Stop  if it is running. 
  2. Unpack the frevvo.war Open <frevvo home>/tomcat/webapps/frevvo file and copy the WEB-INF\data\users\types.xsd file to a temporary location of your choice: e.g. c:\tmp\frevvo-war.
  3. Edit c:\tmp\frevvo-war\WEB-INF\data\users\types.xsd,
  4. Change the element phoneType as shown in the code block below: Save the changes to the types.xsd file. 
  5. Rezip all the files in the c:\tmp\frevvo-war directory, even the ones you did not edit.

  6. Zip will often give your zipfile a .zip extension. Make sure you change this to a .war extension. 

  7. Copy the updated frevvo.war file to <frevvo installdir>/tomcat/webapps.,
  8. Change the element phoneType as shown in the code block below: Save the changes to the types.xsd file. 
  9. Replace the original file with the updated version.

  10. Restart your  form server. Now all your phone controls will validate against this pattern.
Code Block
<xsd:simpleType name="phoneType">     
    <xsd:restriction base="xsd:string">         
        <xsd:pattern value="\d{2}-\d{4}-\d{4}"/>         
        <xsd:pattern value="\d{4}-\d{3}-\d{3}"/>
    </xsd:restriction> 
</xsd:simpleType>

 

 

...