Hi,
I have a text box, when a user enters some value into the text box, that value has to be populated in the url and as well as the value entered in that text box has to be retained.
Javascript code: am using ajax here
ab.php file
If i do this the value entered in the text box will be retained but i want that value to be populated in the url how to i do it??
Somebody plz help me
Thanks
I have a text box, when a user enters some value into the text box, that value has to be populated in the url and as well as the value entered in that text box has to be retained.
Code:
<? echo "<input type='text' id='text1' onchange=\"return_value()\" /> ?>
Code:
var xmlHttp;
function return_value() {
var x=document.getElementById('text1').value;
xmlHttp = GetXmlHttpObject();
if(xmlHttp == null) {
alert("Your browser does not support ajax");
return;
}
var url="ab.php";
url=url+"?x="+x;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
xmlHttp.onreadystatechange = StateChanged;
function StateChanged() {
if(xmlHttp.readyState == 4) {
document.getElementById('toRelease').value = xmlHttp.responseText;
}
}
Code:
<? $y=$_GET['x']; echo $y; ?>
Somebody plz help me
Thanks
Comment