client_side_validations icon indicating copy to clipboard operation
client_side_validations copied to clipboard

turn off validation for a submit button

Open kellerapps opened this issue 14 years ago • 2 comments

I have an edit form with [Save] [Delete] [Cancel] buttons. When Delete/Cancel are clicked, I want the form to submit even if invalid.

kellerapps avatar Feb 15 '12 03:02 kellerapps

c_s_v handles form.onsubmit so the form is always validated when any submit button is clicked or the Enter key is pressed. One solution is to handle button.onclick and Enter.onkeyup instead. If a button contains :validate => false, don't bind onsubmit.

kellerapps avatar May 27 '12 19:05 kellerapps

You will need to use $.die('form') to remove the events. This is a failing of the current public API and will be addressed in 4.0 of the gem

bcardarella avatar Jul 10 '12 01:07 bcardarella