Help tweaking a js function to constructs a URL

I am trying to get a page to update a selection of php mysql results via ajax.
I can get this to work with only 1 dropdown list but I have a maximum of 14 inputs the user can choose from to filter the results. I am using the following script on the page to call the .php page which runs the updated query on the table and returns the filtered results.

The javascript I have on the page which is called using onchange on one of the dropdowns is:

<script type="text/javascript">
function showCars(str)
{
if (str=="")
  {
  document.getElementById("txtHint").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("txtHint").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","getcars.php?q="+str,true);
xmlhttp.send();
}
</script>

I need to get a selection of form inputs to generate a url similar in style to the one shown below:

getCars.php?Make=Claret&Model=2005&Tophats=Funny

Can anyone show me how I can achieve this please? I think if I can bget this bit to work I will be able to sort out the other issues I have with the site I’m working on.

Any help would be extremely appreciated, thanks in advance!

Is anyone able to show me how to construct the url in the way I need to by changing the code I’ve posted? Have I not given enough information? I’m realy struggling with this, please help.

Which method are you using to set up the onchange event of the select box? If you are using the traditional model where scripting assigns a function to the onchange property of the element, that will be easier to help with.

If instead you are using inline event attributes, that will serve to hinder any progress that may be made.