Dit stukje code doet het perfect in FF, maar in IE enabled hij de inputs niet wanneer ik in het selectievakje naar Gallery ga. Iemand enig idee waar dit aan ligt?


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script language="JavaScript">

function checkType(x)
{
	if(x=="Gallery")
	{
		document.getElementById("cols").disabled=false
		document.getElementById("rows").disabled=false
	}else{
		document.getElementById("cols").disabled=true
		document.getElementById("rows").disabled=true
	}
}

</script>
<title>Untitled Document</title>
<link href='css/style.css' rel='stylesheet' title='stylesheet' media='screen' type='text/css'>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table width="400" cellpadding="1" cellspacing="0">
<form>
	<tr>
		<th width="38%" align="left" colspan="2">New page</th>
	</tr>
	<tr>
		<td width="38%" align="right">Page:</td>
		<td width="62%" align="left"><input type="text" name="page" class="field"></td>
	</tr>
	<tr>
		<td width="38%" align="right">Type:</td>
		<td width="62%" align="left">
		<select name="type" onChange="checkType(this.form.type.options[this.form.type.selectedIndex].value)" class="field">
			<option>Standard</option>
			<option>News</option>
			<option>Gallery</option>
			<option>Guestbook</option>
		</select>
		</td>
	</tr>
	<tr>
		<td width='38%' align='right'></td>
		<td width='62%' align='left'><input type='text' id='cols' name='cols' size='2' class='field' disabled> images per row</td>
	</tr>
	<tr>
		<td width='38%' align='right'></td>
		<td width='62%' align='left'><input type='text' id='rows' name='rows' size='2' class='field' disabled> rows per page</td>
	</tr>
	<tr>
		<td width="38%" align="right"></td>
		<td width="62%" align="left"><input type="submit" name="submit" value="Create page" class="button_s"></td>
	</tr>
	<tr>
		<th width="38%" align="left" colspan="2">&nbsp;</th>
	</tr>
</form>
</table>
</body>
</html>



www.orange-clan.com/test.html

B.v.d
Door een alert toe te voegen zie je dat de waarde 'x' steeds leeg blijft..


function checkType(x)
{
	alert(x);

	if(x=="Gallery")
    {
        document.getElementById("cols").disabled=false;
        document.getElementById("rows").disabled=false;
    }else{
        document.getElementById("cols").disabled=true;
        document.getElementById("rows").disabled=true;
    }
}


Ik heb ff voor je lopen prusen, en het blijkt dat je voor IE op persé de value attribuut moet toepassen. dan werkt ie wel..


<option value="Standard">Standard</option>
<option value="News">News</option>
<option value="Gallery">Gallery</option>
<option value="Guestbook">Guestbook</option>


Werkt uitstekend!

Reageren