Ok so i have this form
= form_tag 'some_controller/create', :remote => true do
...
...
.right= submit_tag 'Submit Me', :id => 'submit_me'
.clear
here is my create.js.erb
$('#submit_me').remove();
and my application.js file
$('#submit_me').live('click', function(){
$(this).val("One moment please...");
$(this).prop("disabled", true);
});
The problem is that when i click it the form doesnt submit. If i take out the $(this).prop("disabled", true);
then it submits fine and everything works well but that doesnt make sense as to why I cant disable the button…any suggestions
I think you should handle the more appropriate event here, which is
submitin this case. Plus, don’t use.live()A couple of notes here:
'#Parent'for sure, you can use'body'.clickDOES work, but you have to manually submit the form by doing$('#theForm').submit()