Bug Tracker

Opened 9 years ago

Closed 9 years ago

#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:
Blocked by: Blocking:

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 (1)

comment:1 Changed 9 years ago by dmethvin

Resolution: invalid
Status: newclosed

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

Note: See TracTickets for help on using tickets.