Skip to content

Adding a validation rule for isRequired? #352

@JohnBlazek

Description

@JohnBlazek

I'm looking for a way to check and see if a field I'm editing is both required and matches a certain condition within a validation rule. I'm noticing there is no validation rule that checks to see if a field is required. I would be looking to see if the field is required from the tag itself...

something like:

Formsy.addValidationRule('equalsFieldAndRequired', function (values, value, field) {
return value === values[field] && this.isRequired();

});

Hope this makes sense!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions