Form Validation Toolkit

Delayed Initiation Example

Examples of initiating validation for form controls that are not currently visible. This is helpful when the form controls are hidden (i.e. tabs, accordions or other hidden panels) and the 'required' flag would be positioned in the wrong place because of that.

A delayed initiation mechanism will help the flags appear in the correct positions.

There are two ways of doing this:
  1. $('form').initValidation({'delay_parent': '#acc-panel-2' }): this will try to make the parent container visible temporarily before attaching the flags so the positioning is accurate
  2. $('form').initValidation({'delay_parent': '#acc-panel-2', 'delay': true }): this will create a timer to look for the parent becoming visible, then initiate validation. If method 1 does not work, this is a back up

Section 1

Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.

Section 2

Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna.