#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)
Change History (6)
Changed 15 years ago by
Attachment: | jquery.validate.min.js added |
---|
comment:1 Changed 15 years ago by
need: | Review → Test Case |
---|---|
Owner: | set to joern |
Type: | bug → enhancement |
One possible selector would be find("input, button").filter(".cancel"), avoiding the pure class-selector.
comment:2 Changed 15 years ago by
Summary: | jQuery validate: Turning off validation on back, cancel button → [validate] Turning off validation on back, cancel button |
---|
comment:4 Changed 9 years ago by
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;
}
Note: See
TracTickets for help on using
tickets.
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"