JavaScript rich form

The jSuites.form enhances a basic HTML form bringing various useful features when dealing with HTML forms and its elements. The most useful features are the following:

  1. Tracking any updates (Are you sure)?: It alerts the user before leaving a page when he has unsaved changes in one form.
  2. Validations: Create basic and custom input validations using the element properties.
  3. Data management: It loads data from a remote server to the form elements, and post data for a remote server for persistance.
  4. Events: Intercept and update the submission, create rules and callbacks.
  5. Upload: Integrates with jSuites.files to help upload files to the backend.

Tracking and updates

How it works

The javascript plugin creates a hash based on all form elements and its values. Before the user leaves the page, the tracker will recheck if there were changes in the hash. If the hash is different, the plugin will trigger an alert to the user because there were changes in the form, not saved yet.

It has a very optimized algorithm that works even with dynamic elements and provides a few methods to help the developer to enrich their applications.


How it works

Though some custom HTML element properties is easy to define validations and messages to the user.

Input type definition example

<input type='text' name='name' data-required="true" data-error="The name is a required field">