Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

turn off validation for a submit button #274

kellerapps opened this Issue Feb 15, 2012 · 2 comments


None yet
2 participants

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

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.


bcardarella commented Jul 10, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment