Hi,
I'm trying to update a SELECT form, based on the sub-cat they select (in the first box).
I'm afraid my Javascript is pretty crap,so if there is a better wa of doing this, please let me know
TIA - code is as follows;
Cheers
Andy
I'm trying to update a SELECT form, based on the sub-cat they select (in the first box).
I'm afraid my Javascript is pretty crap,so if there is a better wa of doing this, please let me know

TIA - code is as follows;
Code:
<html>
<head>
<meta http-equiv="Content-Language" content="en-gb">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>SELECT 1</title>
<script>
function change_select(tvalue) {
alert('foo' + tvalue);
document.getElementById(tvalue).style.display = 'block';
}
</script>
</head>
<body>
<select name="selectname" onchange="change_select(this.value)">
<option value="gcse">GCSE</option>
<option value="alevel">A-Level</option>
<option value="uni">University</option>
<option value="ib">I.B.</option>
</select>
<select name="catid">
<div id="ib" name="ib" style="display: none" >
<option value="42">World Literature</option>
<option value="629">Uncategorised</option>
<option value="115">Theory of Knowledge</option>
<option value="257">Psychology</option>
<option value="114">Physics</option>
<option value="47">Misc</option>
</div>
<div id="gcse" name="gcse" style="display: none" >
<option value="2">History</option>
<option value="3">English Literature</option>
<option value="140">William Wordsworth</option>
<option value="4">Politics</option>
<option value="5">English Language</option>
</div>
<div id="alevel" name="alevel" style="display: none" >
<option value="41">Psychology</option>
<option value="338">Art</option>
</div>
<div id="uni" name="uni" style="display: none" >
<option value="43">Economics</option>
<option value="49">Misc</option>
<option value="59">History</option>
<option value="119">Biology</option>
</div>
</select>
</body>
</html>
Cheers
Andy