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

Simple Example With Show / Hide

This is a simple example of form validation. It uses the code displayed on the plugin homepage. Checking off "Yes" will add validation to the second field and make it appear.

Do you like ice cream?
Yes:
What's your favorite flavour?

Here's the plugin code used for this example.

var fValidate = $.parselyConditions({
        formname: 'customForm',
        validationfields: [{
            fid: 'formTrigger',
            ftype: 'checkbox',
            fvalue: 'yes',
            faffected: 'toggledField',
            fhide: 'maskDiv'
        }],
    });