How to submit a form in an ajax function?

powicewobots

New Member
normally my ajax functions look something like this:\[code\]function ajaxCallback(url,functionToRun){if (window.XMLHttpRequest) {// code for new browsers myXMLlhttp=new XMLHttpRequest(); }else {// code for IE6 and lower myXMLlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }myXMLlhttp.onreadystatechange=functionToRun;myXMLlhttp.open("POST",url,true);myXMLlhttp.send();}function getItemList(rep, sort_by_column, order_by){ajaxCallback("scripts/get_item.php?rep="+ rep + "&sort_by_column=" + sort_by_column + "&order_by=" + order_by,function() { if (myXMLlhttp.readyState==4 && myXMLlhttp.status==200) { document.getElementById("main_area").innerHTML=myXMLlhttp.responseText; } });}\[/code\]I would like to somehow submit a form on that page using ajax, I looked at some tutorials / questions but they all suggest JQuery, but is there a way to include that form as a variable Or another way of submitting it, without jQuery? I can find a way around it, but I thought I'd check to see if there was some simple way of doing it.
 
Back
Top