Hey all

Can anyone see why this isn't working for IE but is Firefox? I'm trying to update a div on the page using some javascript and php. Whenever a dropdown box on the html page is changed, its value is passed to a javascript function, then onto a php file. The php file runs and javascript updates the div.

HTML Code:

<script type="text/javascript" src="include/js/tournSearch.js"></script>
<select id="in_out_door" onchange="updateTourns()">
<div id="tourn"></div>

Javascript Code:

var xmlhttp;

function updateTourns() {
	if (xmlhttp==null) {
		alert ("Browser does not support HTTP Request");
	var url = "include/js/tournSearch.php";
	url = url + "?in_out_door1=" + document.getElementById('in_out_door').value;
	url = url + "&class1=" + document.getElementById('class').value;
	url = url + "&region1=" + document.getElementById('region').value;
	url = url + "&level1=" + document.getElementById('level').value;
	url = url + "&year1=" + document.getElementById('year').value;
	url = url + "&sid=" + Math.random();
function stateChanged()	{
	if (xmlhttp.readyState==4)
function GetXmlHttpObject()	{
	if (window.XMLHttpRequest)
		return new XMLHttpRequest();	// code for IE7+, Firefox, Chrome, Opera, Safari
	if (window.ActiveXObject)
		return new ActiveXObject("Microsoft.XMLHTTP");	// code for IE6, IE5
	return null;

Finally, tournSearch.php

$in_out_door = $_GET['in_out_door1'];
$class = $_GET['class1'];
$region = $_GET['region1'];
$level = $_GET['level1'];
$year = $_GET['year1'];
echo $in_out_door . ", " . $class . ", ";

In Firefox whatever was selected from the dropdown box is echo'd. This does not happen in IE.

Thank you!

Not to worry. After much more google searches it appears IE requires value attributes in the select tags

<select id="in_out_door" onchange="updateTourns()">
	<option value="Indoor">Indoor</option>
	<option value="Outdoor">Outdoor</option>
	<option value="Sand">Sand</option>


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.