jquery - Issues sending a form with ajax -
i'm having trouble self-submitting form call ajax code on document ready. want remain on index.php user clicks submit, code not seem live , takes me new_work.php instead. i've read don't need use preventdefault , stoppropagation ajaxform.
var initajaxform = function() { ('#ajax_form').ajaxform({ success: function(data) { $('body').html(data); } }); } $(document).ready(function() { $('body').load("new_work.php", function() { initajaxform(); }); });
nothing important in html markup. empty skeleton form
<form action="new_work.php" method="post" id="ajax_form">
i'm using ajaxform plugin because that's way know send files via ajax. if there's better solution, please let me know! thank you.
edit: error is:
uncaught typeerror: object #ajax_form has no method 'ajaxform'
have loaded jquery form plugin? ajaxform not built standard jquery.
is ajax_form
id of html form?
Comments
Post a Comment