Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

How to validate a field using validation patterns


Level 2


I'm having a problem trying to validate a numeric field in LiveCycle - can't quite figure out how the pattern works...

The field I’m trying to validate is a numeric field from a XSD file. The wanted validation pattern is the user entered value must range between 0-36.

Do any of you know how to do?

Best regards,


1 Reply


Former Community Member


If you are referring to extending a schema restriction in Designer, read on.

Consider the following schema which has a restriction on 'age' of '0-36'

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:element name="customer">
    <xsd:element name="firstName" type="xsd:string"/>
    <xsd:element name="lastName" type="xsd:string"/>
    <xsd:element name="age">
      <xsd:restriction base="xsd:integer">
      <xsd:minInclusive value="0"/>
      <xsd:maxInclusive value="36"/>


Consider starting with a new, blank form and creating the data connection to the schema, above. Once you have created the connection, right-click on the connection name and click 'Generate Fields'.


The fields are added to the form and the restriction on 'age' is automatically turned into validation script on the calculate event of 'age'.