I am trying to use ajaxForm
on my on-the-fly created form. In fact, my application will produce a link 'on the fly' and by clicking on that link, it will produce an ajaxForm
(again on-the-fly by jQuery!), so I used the .live()
function with ajaxForm()
. This is my wrong code:
$('form').live('submit', function() {
$(this).ajaxForm({dataType: 'html', success: function(data) {
alert(data);
}});
return false; // For preventing page refresh!
});
In my form, when I click the submit button, the page refreshes.
Is there a solution?