I'm doing like this:
$('.myforms').ajaxForm();
after I add some more forms to the html which have this .myforms class assigned, so I have to call the $('.myforms').ajaxForm() again
is it possible to register the ajaxForm live ?
I'm doing like this:
$('.myforms').ajaxForm();
after I add some more forms to the html which have this .myforms class assigned, so I have to call the $('.myforms').ajaxForm() again
is it possible to register the ajaxForm live ?
checkout the Live Query plugin. It allows you to simulate the .live() but extends the behaviour to DOM elements, not just events.
Not with jQuery's live(), but you could monitor the form for changes to the DOM and trigger ajaxForm() from there. See this thread
You do not need to use jQuery live, all you need to do is put the ajaxForm code inside a function and then in the ajax success you just call the function again to rebind the new form in the view.
function bindSubmitNewPost() {
var options = {
target: '#new-post-message-1',
beforeSubmit: showRequest,
success: showResponse
};
$('.FormNewPost').ajaxForm(options);
}