Then I am replacing an "edit" form with the following in an AJAX form:
< Code> $ ('# review form'). AjaxForm ({Success: Work (feedback) {$ ('# Book Review'). Html (feedback);}});
This gives the same form, which can be edited again, if necessary, after presenting it on the other side, it is no longer attached to the ajaxform (), which makes sense is.
How can I ensure that this form is always an AJAX form, no matter how many submissions, how does the same () function work?
You can call either like ajaxform
response:
& lt ;! - HTML for the form - & gt; & Lt; Script type = "text / javascript" & gt; . $ ('# ReviewForm') ajaxForm (); & Lt; / Script & gt;
Or you can do it as part of the success function:
function ajaxify (response, position, xhr, form) {var review = $ ('#bookReview') HTML (feedback). $ ('Form # review form', review) .Jaxform ({'success': Ajax ify}); } $ ('# ReviewForm'). Ajaxform ({'success': ajaxify});
I recommend the latter.
Comments
Post a Comment