Hey, no problem! I appreciate the help:
Here's the select box code, I use some PHP variables to create it, but this is what the ending HTML looks like:
<select name="program_10_25" onchange="update_program(25, this.form.program_10_25.value, 10);">
Here's the function I'm using, I'm also referencing an AJAX object to start the request (1st Code) then the function being called to run the PHP script (2nd Code):
// Initialize the object:
var ajax = false;
// Create the object...
// Choose object type based upon what's supported:
if (window.XMLHttpRequest) {
// IE 7, Mozilla, Safari, Firefox, Opera, most browsers:
ajax = new XMLHttpRequest();
} else if (window.ActiveXObject) { // Older IE browsers
// Create type Msxml2.XMLHTTP, if possible:
try {
ajax = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e1) { // Create the older type instead:
try {
ajax = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e2) { }
}
}
function update_program(roster, badge, time) {
if (ajax) { // Confirm that the object is usable
ajax.open('get', 'scripts/updateprogram.php?roster=' + encodeURIComponent(roster) + '&badge=' + encodeURIComponent(badge) + '&time=' + encodeURIComponent(time)); // Call the PHP script using GET, pass the variable
//ajax.onreadystatechange = handle_programupdate; // Function that handles the response
ajax.send(null); // Send the request
}
}
And the PHP processing page is a simple connect to DB (using require_once), validation of variables, and then update script, shown below:
if ($error == false) {
$q = "UPDATE roster_bs SET program_10='15' WHERE id='25'";
$r = mysql_query($q);
echo $q;
}
I know the PHP script is fine... I can run it standalone, and withouth the AJAX with no problem. Like I said, it seems to work flawlessly in Firefox, but when I use it in IE7, it breaks about 90% of the time. Oddly, it usually won't update if I select an option above the current selection, but will almost always update if I select something below the current selection. Any help is well appreciated!