Bug Tracker

Modify

Ticket #6473 (closed bug: invalid)

Opened 3 years ago

Last modified 3 years ago

[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

comment:1 Changed 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

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

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.