hi,
i'm having the following problem, normaly i work with html css and php but for this to work i need to make a litle javascript function and i'm still kinda new to it. so here is my problem.
i'm making a search field where someone has to select some radiobuttons.
first it has a selection out of 4 items and then a selection out of like 20 but how do i get the value from the first function in the second?
in this case i would like to have the following in function showStreek:
xmlhttp.open("GET","test3.php?l="+land,true);
this line should look like:
xmlhttp.open("GET","test3.php?k="+kleur"l="+land,true);
or something like that'.
what in fact i want to do is send 2 variables but i don't know how to do this.
can anyone explain this to me?
function showLand(kleur)
{
if (kleur=="")
{
document.getElementById("txtland").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtland").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","test2.php?k="+kleur,true);
xmlhttp.send();
}
function showStreek(land)
{
if (land=="")
{
document.getElementById("txtstreek").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtstreek").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","test3.php?l="+land,true);
xmlhttp.send();
}