View on GitHub

Parsely-conditions

A jQuery plugin that adds conditional logic to the Parsely.js form validation library

Download this project as a .zip file Download this project as a tar.gz file

< Back to home

Multi-Field Example

This example shows how you can make multiple fields appear, and toggle validation on all fields from a single trigger field. Selecting "No" shows multiple fields and adds validation to each new field.

Is your shipping address the same?
Yes:
No:
Your address:

Type of address:
Home
Business

Here's the plugin code used for this example.

var fValidate = $.parselyConditions({
        formname: 'customForm',
        validationfields: [{
            fid: 'formTrigger',
            ftype: 'radio',
            fvalue: 'different',
            faffected: ['address','type'],
            fhide: 'maskDiv'
        }],
    });