help me i have this javascript and it puts a page into and div
i need to be able to post into the div
all i need to do is stop the form from submitting and onsubmit get the values of the form e.g. <input type="text" name="post" value="abc"> and get the javascript to be able to put that in the url
which i need to know how to do and place it in that and it should work.. i have page.php to tell me if it works or not xD
function realTimePost(form)
{
var xmlhttp;
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
var url="page.php";
url=url+"&post="+INPUTVAR-HERE IS WHAT I NEED;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
function stateChanged()
{
if (xmlhttp.readyState==4)
{
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
}
Question
Evil Penguin
help me i have this javascript and it puts a page into and div
i need to be able to post into the div
all i need to do is stop the form from submitting and onsubmit get the values of the form e.g. <input type="text" name="post" value="abc"> and get the javascript to be able to put that in the url
which i need to know how to do and place it in that and it should work.. i have page.php to tell me if it works or not xD
function realTimePost(form) { var xmlhttp; xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Browser does not support HTTP Request"); return; } var url="page.php"; url=url+"&post="+INPUTVAR-HERE IS WHAT I NEED; xmlhttp.onreadystatechange=stateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); function stateChanged() { if (xmlhttp.readyState==4) { document.getElementById("myDiv").innerHTML=xmlhttp.responseText; } }thanks in advance :)
Edited by Evil PenguinLink to comment
Share on other sites
4 answers to this question
Recommended Posts