Building Forms

The Form Service can be used to build some very sophisticated forms and includes directives that allow you to add:

  • input controls
  • control groups
  • steppers
  • inline instructions
  • input validators
  • element lists
  • rules controlling the visibility of form elements

Jsonforms itself has moderately good documentation on how this all works; please read through their information to get a better sense of how the schemas need to be set up. If you wish to dive right in, however, here’s how you can easily build and preview your forms through ADSP’s Form Editor.

Steppers

Many forms at the GoA can be rather large and complex, and could be divided into a number of smaller steps for ease of use. This is where form steppers become useful.

Form Rules

Sometimes a specific answer to a question will influence the flow of the form. A yes answer, for example, may uncover further questions, or a particular income value may disable followup questions. Jsonforms uses rules to handle the dynamic aspects of form intake.

Input Validation

Jsonforms automatically handles basic input validation, such as ensuring required fields are filled in, dates are formatted correctly, or that numbers are, indeed, numbers. More sophisticated validation is also possible; you can add custom error messages or even integrate a custom AJV validator to harness the full power of AJV, which gives you complete control over validation.

Repeating Items

You will sometimes need to capture lists of information in a form. Lists contain a variable number of items, each containing the necessary details. For example, an application for a Farmers Market License may require list of vendors, each with contact information, a classification, and their expected yearly revenue. Users are able to add one item at a time and fill in the details as needed.

ADSP Enhancements

ADSP has added several enhancements to the form builder in order to help designers and developers create professional looking forms. These include:

Learn More

  • Learn how to use jsonforms to declaratively build and render your forms.