Hi and thanks.
I have the following functions:
// NATION
var x, y, z;
function flag(nation,area)
{
x = nation;
this.nation=nation;
var el=document.getElementById("desc");
el.innerHTML='The region you have selected is <b>'+area+'</b>';
document.getElementById("flag").innerHTML='<img src="images/flags/'+nation+'.jpg">';
}
// SERVICE
function output(service)
{
y = service;
this.service=service;
var el=document.getElementById("service-desc");
el.innerHTML='You have selected a <b>'+service+'</b> service.';
document.getElementById("clock").innerHTML='<img src="images/clock-'+service+'.png">';
}
And once the user has set the variables: nation & service have been set then I would like to run this function:
function selectmodel()
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
{
alert ("Your browser does not support XMLHTTP!");
return;
}
var location=x;
var time=y;
var weight=z;
var url="selectmodel.php";
url=url+'?location='+location+'&time='+time+'&weight='+weight;
xmlhttp.onreadystatechange=stateChanged1;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
window.location.hash="slider";
}
function stateChanged1()
{
if (xmlhttp.readyState==4)
{
document.getElementById("result").innerHTML=xmlhttp.responseText;
}
}
Please can somebody be knid enough to let me know how to do this?
Thanks, B.
EDIT - Sorry forgot to say that the variables are come from onclick's (onClick="flag('scotislands', 'Scottish islands');")