When I submit my form, I want get a success when success the form. I’m using jquery ujs
$('#new_invitation').submit(function(e) {
var $this = $(this);
$this.on('ajax:success', function(e) {
alert ('Success');
});
});
The alert with Success is not fired :(.
Why?
how are you doing? It seems to me that you are not actually submitting your form using AJAX since The submit() function will trigger the normal submission of the form. Can you try this code?
This assuming the ‘#new_invitation’ is the ID of the form tag. I recommend you take a look at the jQuery docs site, they have a wealth of information about AJAX: http://api.jquery.com/jQuery.post/
Good luck!