bernat / best_in_place

A RESTful unobtrusive jQuery Inplace-Editor and a helper as a Rails Gem
http://blog.bernatfarrero.com/in-place-editing-with-javascript-jquery-and-rails-3/
1.2k stars 571 forks source link

Cancel button onClick event #496

Open btazi opened 9 years ago

btazi commented 9 years ago

I'm struggling with a simple issue. I want to do something when the user clicks the cancel button so I added this simple javascript:

$("body").on('click', 'input.btn-warning', function() { alert("test") }); The best_in_place cancel button has the btn-warning class, but it is isn't working. So I'm wondering if there is any event firing when the user clicks the cancel button, or if I can add an html onClick event attribute to that button. Any suggestion/answer would be greatly appreciated !

I have asked this question on stackoverflow: http://stackoverflow.com/questions/31145515/cancel-button-onclick-event-with-best-in-place