Versions Compared

Key

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

One of Live Forms ' 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. The Live Forms application does this by:

Column
width240px

 On This Page:

Table of Contents
maxLevel1

Live Forms controls  controls may be marked as required or optional by editing the control 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).

When a form is initially created, Live Forms   will automatically disable the Submit button if there are any required controls that do not contain valid values. Validation for controls you generate from schema elements depends on the element’s XSD type and other schema-specific information.

...

If the user changes his/her mind and removes the value from the Street field, Live Forms   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, Live Forms is automatically ensuring that it is not possible to submit a form that is in an invalid state and that would generate an invalid document.

Input Validation

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

...

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

Numbers with commas

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

...

  • Set the pattern to: ([0-9]{1,3},([0-9]{3},)*[0-9]{3}|[0-9]+)(\.[0-9][0-9])?

EMail pattern

If you use Live Forms use  In-house (downloaded and installed on your computer), you can change Live Forms ' s built-in patterns for the Email control by editing the ''types.xsd'' file located in <frevvo installdir>/data/users directory. This file includes the email type definition shown below, and you can edit its pattern value.

...

Lets say you would like to change the phone control validation from the Live Forms's current built-in pattern to: ##-####-#### or ####-###-###

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

...

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>

Restart your Live Forms your  form server. Now all you phone controls will validate against this pattern.

If you are using Live Forms 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.

...