Patternslib/Patterns

pat-validation: Allow submission for formnovalidate buttons

Closed this issue · 3 comments

thet commented

In Plone all action buttons are submit buttons, including the cancel button.
We're going to add a formnovalidate attribute in plone.app.z3cform to those buttons which should skip the validation, like the cancel button, See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-formnovalidate

We need to make sure that pat-validation respects the formnovalidate attribute and allows the form to be submitted without validation.

thet commented

I agree. There are cases where it might needed - for example if the cancel button modifies the server state. In Plone we have a locking mechanism - when someone edits a document the document is locked so that others cannot modify it. When hitting "cancel" the lock has to be released.
I think that is the reason why the cancel button is a submit button in default Plone.

thet commented

Fixed with 35f4227
from: #966