aximbigfan
03-18-2008, 06:07 PM
I have been to 3 different forums now. Every time I post this, someone says "O LOL, that not right, try this script lol!!!!" and then I try it, it doesn't work, and that person never shows up again.
Can some one, anyone PLEASE HELP ME?!?!?!
Ok...
I have a form (called "form") and a textbox in that form, called "string".
I want to send the contents of string out, with a few other hidden fields, an then write the result in document.form.string.value.
I have this:
var http = \"\";
function ajax()
{
var http;
try
{
http = new XMLHttpRequest;
}
catch (e)
{
try
{
http = new ActiveXObject(\"Msxml2.XMLHTTP\");
}
catch (e)
{
try
{
http = new ActiveXObject(\"Microsoft.XMLHTTP\");
}
catch (e)
{
alert(\"AJAX error!\");
return;
}
}
}
http.onreadystatechange = function()
{
if (http.readystate == 4)
{
if (http.status == 200)
{
alert('test');
document.form.string.value = http.responceText;
}
else
{
alert(\"AJAX error!\");
}
}
}
var str = \"mode=\" + document.form.mode.value;
str += \"&string=\" + document.form.string.value;
str += \"&key=\" + document.form.key.value;
str += \"&find=\" + document.form.find.value;
str += \"&replace=\" + document.form.replace.value;
str += \"&gen=\" + document.form.gen.value;
http.open(\"POST\",\"index.php\", true);
http.setRequestHeader(\"content-type\",\"application/x-www-form-urlencoded\");
http.send(str);
}
..but it does not work. Why?
Can someone please help me?!
Chris
Can some one, anyone PLEASE HELP ME?!?!?!
Ok...
I have a form (called "form") and a textbox in that form, called "string".
I want to send the contents of string out, with a few other hidden fields, an then write the result in document.form.string.value.
I have this:
var http = \"\";
function ajax()
{
var http;
try
{
http = new XMLHttpRequest;
}
catch (e)
{
try
{
http = new ActiveXObject(\"Msxml2.XMLHTTP\");
}
catch (e)
{
try
{
http = new ActiveXObject(\"Microsoft.XMLHTTP\");
}
catch (e)
{
alert(\"AJAX error!\");
return;
}
}
}
http.onreadystatechange = function()
{
if (http.readystate == 4)
{
if (http.status == 200)
{
alert('test');
document.form.string.value = http.responceText;
}
else
{
alert(\"AJAX error!\");
}
}
}
var str = \"mode=\" + document.form.mode.value;
str += \"&string=\" + document.form.string.value;
str += \"&key=\" + document.form.key.value;
str += \"&find=\" + document.form.find.value;
str += \"&replace=\" + document.form.replace.value;
str += \"&gen=\" + document.form.gen.value;
http.open(\"POST\",\"index.php\", true);
http.setRequestHeader(\"content-type\",\"application/x-www-form-urlencoded\");
http.send(str);
}
..but it does not work. Why?
Can someone please help me?!
Chris