I'm facing an issue with using AJAX to update a section of my website when the drop-down box is changed. The problem I am encountering is passing the parameters correctly to the function.
Below is the HTML code:
<script type='text/javascript' src='ajax.js'></script> //Location of the function
<div id="combobox" style="width: 150px; height: 300px; overflow-y: scroll">
<select onchange="MakeRequest(test); location = this.options[this.selectedIndex].value;">
<option>Races</option>
<?php ComboBox() ?>
</select>
.
.
Here is the AJAX function located in an external file, ajax.js:
function MakeRequest(test) {
var linkInfo = "teleport.php?call=" + test;
var xmlHttp = getXMLHttp();
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState == 4) {
HandleResponse(xmlHttp.responseText);
}
}
xmlHttp.open("GET", linkInfo, true);
xmlHttp.send(null);
}
Can anyone provide guidance on how to resolve this issue?