Parsley

Parsley Validator Demo

<< Back to examplesTry it on CodePen

Correctly fill at least one of these blocks


This example uses a trick. It uses a <div> tag like if it was an input. That input uses a custom validator that succeeds only if one of the groups (here "block-1" and "block-2") validate with the force option set.

Note that the <div> contains the fields in question. This way, events like change or input generated when the user fills in these fields will bubble up to the div and revalidate the custom field.