I use the function below:
function ajaxrequestpage(asppagename,str,str2) { divID=str2 setHeight=str.split("DIVHEIGHT="); xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support AJAX!"); return; } var url=asppagename; url=url+"?"+str; url=url+"&divID="+divID; url=url+"&sid="+Math.random(); xmlhttp.onreadystatechange=stateChanged3; xmlhttp.open("GET",url,true); xmlhttp.send(null); }
To call the Form into the page. That part works fine. When I attempt to submit the form however the page refreshes. I am attempting to submit the form with The JQuery Form Plugin. (Source)
<script type="text/javascript"> // wait for the DOM to be loaded $(document).ready(function() { // bind 'myForm' and provide a simple callback function $('#myForm').ajaxForm(function() { alert("Thank you for your comment!"); }); }); </script>
If I put the form in the page directly I am able to submit the form without the page loading, but because I am pulling a page externally with AJAX it submits and refreshes the page.
Any ideas?
Thanks!