jQuery - Post Form Loaded from another page using AJAX -



jQuery - Post Form Loaded from another page using AJAX -

i trying utilize jquery submit form without reloading page. although works jquery form plugin on standalone page need work on page i've loaded ajax.

<script type="text/javascript"> $('#loadform').click(function() { $('#formdiv1').load('formgen.asp'); }); </script>

when click submit on loaded form however, form submits , refreshes page instead of submitting ajax.

<script type="text/javascript"> // wait dom loaded $(document).ready(function() { // bind 'myform' , provide simple callback function $('#myform').ajaxform(function() { alert("thank comment!"); }); }); </script>

if set code in page phone call , utilize standalone works perfect. doesn't work when attempting load form page.

you need utilize on() method bind things beingness loaded ajax - http://api.jquery.com/on/

jquery ajax load ajaxform

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -