You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to do the same.
With parseley, you can validate if one of two fields is filled up with the following code:
`
$('#myform').parsley().on('form:validate', function (formInstance) {
if(formInstance.isValid({group: 'group1', force: true}) ||
formInstance.isValid({group: 'group2', force: true}) ||
formInstance.isValid({group: 'group3', force: true})) {
//do nothing
}
else {
$('#errorContainer').html('You must correctly fill at least one of these three groups!');
formInstance.validationResult = false;
}
});`
Hi, great module!
I was wondering if I could use this to validate client-side if one of two fields from the form were used (only one of both is required).
So let's say you can either upload a file or a provide a link, so I want to validate that only one of these two is filled.
Thanks!
The text was updated successfully, but these errors were encountered: