Section | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
You can find information about the section Required property here.
Warning |
---|
Avoid using message, image and video controls inside a section that contains other controls that you may want to set to required/not required (either via the Forms Designer or using Business Rules. Since these three control types always contains a value, it can cause a section, or other controls in a section, to become required. If you must include a these control types, place it outside the section. Another alternative is to write rules for the individual controls within a section to set them to visibile/invisibile or required/not required. |
Input Validation
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.
...
Code Block |
---|
([1-9]|[1-3][0-9]|4[0-2]) |
Patterns i.e. regular expressions take into consideration each character that is entered instead of the whole value that is entered. Here is the explanation for the pattern shown above:
- [1-9] – means any number between one and nine will satisfy the pattern. So this covers the range of numbers between 0 and 9.
- | - OR operator
- [1-3][0-9] – means first digit can be between 1 and 3 and second digit can be between 0 and 8 to satisfy the pattern. So this covers the range of numbers between 10 and 39.
- | - OR operator
- 4[0-2] – means first digit can be 4 and second digit can be 0 or 1 or 2 to satisfy this pattern. So this covers the range of numbers between 40 to 42
Numbers with commas
' default number control supports digits followed by an optional decimal point and multiple decimal places. Suppose instead you want to allow numbers containing commas and optionally starting with a '$' and only up to 2 decimal places. For example: $1,000.50 2,500. But also to allow numbers without the comma such as $1000. To do this:
...
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
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
- Apply patterns to a control - Like other control properties, the pattern property will not need to be redone when you upgrade .
- 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.
Apply a Pattern to a Control for a Phone Number
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
- Drag a Text control to your form
- Add your pattern to the Text control's pattern property: \d{2}-\d{4}-\d{4} or \d{4}-\d{3}-\d{3}
- Change the error message and help properties to assist the user in understanding the required pattern
Modify the types.xsd file
frevvo OEM partners may choose this method when customizing . The built-in values are shown in the image below:
...
- Stop if it is running.
- Unpack the frevvo.war file to a temporary location of your choice: e.g. c:\tmp\frevvo-war.
- Edit c:\tmp\frevvo-war\WEB-INF\data\users\types.xsd,
- Change the element phoneType as shown in the code block below: Save the changes to the types.xsd file.
Rezip all the files in the c:\tmp\frevvo-war directory, even the ones you did not edit.
Zip will often give your zipfile a .zip extension. Make sure you change this to a .war extension.
- Copy the updated frevvo.war file to <frevvo installdir>/tomcat/webapps.
- 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> |
If you are using Online, you will not have access to types.xsd. You 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.
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
- Drag a Text control to your form
- Add your pattern to the Text control's pattern property: \d{2}-\d{4}-\d{4}|\d{4}-\d{3}-\d{3}
- Change the error message and help properties to assist the user in understanding the required pattern
...