Bug Tracker

Opened 15 years ago

Closed 15 years ago

Last modified 9 years ago

#2989 closed enhancement (fixed)

[validate] Turning off validation on back, cancel button

Reported by: magleahy Owned by: joern
Priority: major Milestone: 1.3
Component: plugin Version: 1.2.6
Keywords: validation off back cancel Cc: mag@…
Blocked by: Blocking:

Description

The requirement would be to be able to press a back or cancel button or input and for validation to be turned off/ignored/diasabled.

At the moment the code does this for input type="submit" but I need it to work for input type="image".

Attachments (1)

jquery.validate.min.js (24.8 KB) - added by magleahy 15 years ago.
This is the jquery validation file with code changed from: this.find(".cancel:submit").click(function() { to: this.find(".cancel").click(function() { so that the cancel class turns off validation for both input type="submit" and input type="image"

Download all attachments as: .zip

Change History (6)

Changed 15 years ago by magleahy

Attachment: jquery.validate.min.js added

This is the jquery validation file with code changed from: this.find(".cancel:submit").click(function() { to: this.find(".cancel").click(function() { so that the cancel class turns off validation for both input type="submit" and input type="image"

comment:1 Changed 15 years ago by joern

need: ReviewTest Case
Owner: set to joern
Type: bugenhancement

One possible selector would be find("input, button").filter(".cancel"), avoiding the pure class-selector.

comment:2 Changed 15 years ago by joern

Summary: jQuery validate: Turning off validation on back, cancel button[validate] Turning off validation on back, cancel button

comment:3 Changed 15 years ago by joern

Resolution: fixed
Status: newclosed

Fixed in [5762].

comment:4 Changed 9 years ago by chris@…

Hi there,

found this thread today. To realize a back-button with class="back" I added this code to jquery.validate.js at line 28:

if ($(event.target).hasClass("back")) {

validator.cancelSubmit = true; history.back(); return false;

}

comment:5 Changed 9 years ago by magleahy

Thanks. Awesome.

Note: See TracTickets for help on using tickets.