Versions Compared

Key

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

One of frevvo's 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 frevvo does this by:

Required Controls and Validation

frevvo controls may be marked as required or optional by setting the control's required property in edit mode. Controls that are generated from an uploaded schema will automatically be designated as required or optional depending on the schema (for example, whether the control is required based on the minOccurs value). Validation for controls you generate from schema elements depends on the element’s XSD type and other schema-specific information.

...

Here is a form that is missing values in the required fields.

Image RemovedImage Added

Here is the form when the user has entered valid values into the required fields.

Image RemovedImage Added

And another that has a value in the field but the value is invalid for the given field type. Notice the error message, yellow background, and the warning icon. When the user enters a valid value in the phone control and clicks the Submit button the form will be submitted.

Image RemovedImage Added

Note that the Email Address and Phone controls are optional. The form may be submitted even though there are no values in these controls. However, if the user enters an invalid value in one of the fields (required or not), will frevvo will prevent form submission.

Image RemovedImage Added

When a form has sections or tabs, the submission may not be allowed due to invalid controls that are not currently visible. For example, a section that is collapsed or a tab that is not currently selected may have an invalid control. This is indicated in the header section and tab label color changing to red.

Image RemovedImage Added

Invalid Form Notification for Users

Consider the scenario where there are several required fields in a form and the user clicks the submit button having missed a few of them.  will frevvo will not allow the form to be submitted due to the empty required fields. The user must provide the information for these fields but it is not immediately obvious what data is missing. The user is forced to scroll up the form to find the errors.

provides frevvo provides a method to show validation errors at the time of submission. Here's how it works:

  • The Submit button is never dimmed.
  • If you click Submit and the form is invalid (cannot be submitted) all invalid control fields are highlighted with a background color. The color shown in the image is the default. The designer can specify this color by changing the value for (Submit Error Highlight) in a Style and then applying that style to the form.

Image RemovedImage Added

  • Once the required fields have been filled and/or invalid data has been corrected, the highlight color will disappear and the form can be submitted by clicking the Submit button.
  • The designer can add a message control(s) to the form with a customized message to alert the user that the form cannot be submitted and what they need to do to correct it.
    • The message control must contain your text in the message area and the CSS class f-submit-error specified in the CSS class property.
      Image RemovedImage Added

    • A message control with this CSS class is invisible by default. When the error condition is met, these message controls become visible.
    • You can use select a Message Type and use all the properties on the Style tab to style your message.

 Image RemovedImage Added

  • Once the required fields have been filled and/or invalid data has been corrected, the highlight color will disappear and the form can be submitted by clicking the Submit button.

...

Optional sections can cause the validity of a form to change dynamically. For example, consider the following form:

Image RemovedImage Added

The Required property is selected for the Name field and all the controls inside of the Address section. The Required property is NOT selected on the Address section control making the section and the controls inside of it optional. If the user enters a valid value in the Name field then clicks Submit the form may be submitted.   However, if the user chooses to enter an address, then the controls in the Address section become required as indicated by the yellow background in the City, State, and Zip fields.

Image RemovedImage Added

If the user enters a value in the Street and City fields, then clicks Submit, the Zip field is highlighted with a background color and the form will not be submitted until valid values are entered in the three newly required fields.

Image RemovedImage Added

If the user changes his/her mind and removes the value from the Street field,  will frevvo will recalculate the validity of the form and infer that the Address section is no longer invalid since it is optional. The generated XML instance document will also not contain an address element. Once again,  automatically  frevvo automatically ensures that it is not possible to submit a form that is in an invalid state and that would generate an invalid document.

Image RemovedImage Added

You can find information about the section Required property here.

...

Input Validation

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

...

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.

Image RemovedImage Added

Patterns

Patterns impose additional validation on what users enter in a particular control. See Designing Forms with Patterns for information on setting a pattern on any control in your form. Patterns are XML schema regular expressions.

Note
  • DO NOT use the typical leading ^ and trailing $ characters in your patterns. These two characters represent the beginning and end of line markers and do not apply to  form frevvo form field values.
  • It is important to use a text control for most patterns. For example, a zip code requires a '-' character. If a '-' is used in a number control the pattern will fail, as a number control does not allow non-numeric characters.

...

Code Block
([1-9]|[1-3][0-9]|4[0-2])

Numbers with commas

frevvo' default s 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:

...

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

EMail pattern

If you use  On frevvo On Premise (downloaded and installed on your computer), you can change frevvo's 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.

...

Let's say you would like to change the phone control validation from the frevvo's 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 frevvo.
  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 frevvo upgrade or apply a  patchfrevvo patch.
Apply a Pattern to a Control for a Phone Number

If you are using  Onlineusing frevvo Online, you will not have access to types.xsd. Both Cloud and On Premise 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 frevvo.

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 frevvo.  The built-in values are shown in the image below:

...

Follow these steps to change the current built-in pattern to  ##-####-#### or ####-###-###.

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

  1. Stop  if frevvo if it is running. 
  2. Open <frevvo home>/tomcat/webapps/frevvo file and copy the WEB-INF\data\users\types.xsd file to a temporary location of your choice.
  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. Replace the original file with the updated version.

  6. Restart your  form your frevvo form server. Now all your phone controls will validate against this pattern.

...

Here are some common conditions in which the user may see this icon: 

  • Rules, Document Actions, or Form actions are being executed
  • A schema-bound / Doc URI table is populated
  • A table is populated from a Google sheet
  • A table/repeat control is scaled from few to many or many to few rows through rules
  • A large amount of data is populated in the dropdown through query
  • A ComboBox searches for a typed-in value
  • PDF generation takes a long time upon form submit 

...

Info

Most business users can safely ignore the xml, but it can be helpful when debugging a form and when integrating with another entity such as a database.

frevvo automatically manages the set of XML instance documents that are generated by a submitted form to ensure that it is valid with respect to the document types in the form. The validity of values is enforced as described in Valid Forms#RequiredControlsandValidation RequiredControlsandValidation and in the discussion on patterns.

However,  also frevvo also ensures that the structure of a submitted document conforms to its type. This is best explained with an example. Consider the following schema fragment uploaded to frevvo.

Code Block
<xsd:element name="customer">   
  <xsd:complexType>     
   <xsd:sequence>       
     <xsd:element name="firstname" type="xsd:string"/>        
     <xsd:element name="lastname" type="xsd:string"/>
     <xsd:element name="fullname" type="xsd:string"/>      
   </xsd:sequence>   
  </xsd:complexType> 
</xsd:element>

Assume that the user adds the element customer to the form's types. All three elements (firstname, lastname, and fullname) are required by the type. But, the form designer is not obligated to add all three controls to the form. Let's say the designer adds controls for firstname and lastname but omits fullname. The form will have two invalid controls when initially loaded. 

...

However, this would generate an invalid XML document with respect to the schema since the schema specifies that a customer must also have a fullname.  manages frevvo manages this automatically by creating an empty fullname element in the document. The generated document looks like this:

...