Hello..i've prob here..the prob is, is't some simple way to do these function.this is because, i have to do all again the code if the selected item is to many.
These function actually change the different output base on the selected item for "Report Name".
Plzz help me...


below is the code:



<html>
<head>
<title>Testing Daa...</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.dropcontent{
width: 300px;
height: 140px;
border: 0;
background-color: #FFFFFF;
display:block;
}
</style>

<script type="text/javascript">

if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.dropcontent{display:none;}\n')
document.write('</style>\n')
}

function contractall(){
if (document.getElementById){
var inc=0
while (document.getElementById("dropmsg"+inc)){
document.getElementById("dropmsg"+inc).style.display="none"
inc++
}
}
}

function expandone(){
if (document.getElementById){
var selectedItem=document.dropmsgform.dropmsgoption.selectedIndex
contractall()
document.getElementById("dropmsg"+selectedItem).style.display="block"
}
}

if (window.addEventListener)
window.addEventListener("load", expandone, false)
else if (window.attachEvent)
window.attachEvent("onload", expandone)

</script>


</head>

<body>

<table width="800" border="0" cellpadding="0" cellspacing="0" >
<!--DWLayoutTable-->
<tr>

<form name="dropmsgform">

Report Name<br>
<select name="dropmsgoption" size="1" style="width:210" onChange="expandone()">
<option>Alarm By Alarm Type By Day</option>
<option>Alarm By Alarm Type By Month</option>
<option>Audit Trail</option>
<option>Case Manager Activity Report</option>
<option>Cases By Fraud Type</option>
<option>CDR Archive List</option>
<option>Resolved Case Detailed List</option>
</select>

<div id="dropmsg0" class="dropcontent">
<br>
Start Date<br>
<input name="" type="text">
<br>
End Date<br>
<input name="" type="text">
</div>
<div id="dropmsg1" class="dropcontent">
<br>
Month<br>
<select name="" style ="width:100">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select>
<br>
Year<br>
<input name="" type="text">

</div>

<div id="dropmsg2" class="dropcontent">
<br>
Start Date<br>
<input name="" type="text">
<br>
End Date<br>
<input name="" type="text">
</div>

<div id="dropmsg3" class="dropcontent">
<br>
Start Date<br>
<input name="" type="text">
<br>
End Date<br>
<input name="" type="text">
</div>

<div id="dropmsg4" class="dropcontent">
<br>
Start Date<br>
<input name="" type="text">
<br>
End Date<br>
<input name="" type="text">
</div>

<div id="dropmsg5" class="dropcontent">
<br>
Start Date<br>
<input name="" type="text">
<br>
End Date<br>
<input name=""type="text">
<br>
Service No<br>
<input name="" type="text">
</div>

<div id="dropmsg6" class="dropcontent">
<br>
Start Date<br>
<input name=""type="text">
<br>
End Date<br>
<input name="" type="text">

</div>



</form>
</tr>
<tr>
<td height="521">&nbsp;</td>
</tr>
</table>
</body>
</html>