Ticket #6473 (closed bug: invalid)
[validate] - cancel button submits form when it should not
| Reported by: | stephenp | Owned by: | |
|---|---|---|---|
| Priority: | Milestone: | 1.4.3 | |
| Component: | unfiled | Version: | 1.4.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Add a button with class "cancel" and the validation plugin handles the cancellation. Cool. But maybe I'm confused. Wouldn't pressing a Cancel button NOT submit the form. Instead, it is implemented the opposite way, where clicking Cancel skips validation and submits the form directly. That seems nuts to me. A user clicks Cancel, no form submit should happen and user code should close the form or whatnot.
The code that submits the form is found on line 74
if ( validator.cancelSubmit ) {
validator.cancelSubmit = false; return handle();
}
When it returns "handle()", that submits the form directly. Why doesn't it just return false?
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

This bug tracker is for jQuery core. Please ask other questions on the forum, or report them using the method requested on the plugin's home page.
http://forum.jquery.com