I think I may have already posted something similar but I cant find it so i will psot it again.
I have a drop-down selection box on an HTML page and when you select a value in the box that changes the value it should call a function. However it doesn't work and it is driving me nuts because it should be right the way i see it.
If anyoine sees what I am missing please let me know what it is and how i can fix it.
I have a drop-down selection box on an HTML page and when you select a value in the box that changes the value it should call a function. However it doesn't work and it is driving me nuts because it should be right the way i see it.
If anyoine sees what I am missing please let me know what it is and how i can fix it.
Code:
<script type="text/javascript">
function getRange(val){
alert("inside getRange()");
if(val==2){
inner="<input id =\"startdate\" type=\"text\"><img src=\"/sslcert-portlet/img/calendar.png\" onclick=\"return showCalendar(\'strtdate\',\'%m/%d/%Y\');\"";
inner=inner+" To <input id=\"enddate\" type=\"text\"><img src=\"/sslcert-portlet/img/calendar.png\" onclick=\"return showCalendar(\'enddate\', \'%m/%d/%Y\');\"><br /><br /><br />";
document.getElementById("range").innerHTML=inner;
}
}
</script>
<table>
<tr><td></td></tr>
<tr><td>Select Report Type</td></tr>
<tr><td>
<select id="reportType" onchange="getRange(this.selectedIndex);">
<option value="0" SELECTED="selected">...</option>
<option value="1">45 Day Report</option>
<option value="2">Custom...</option>
</select>
</td></tr>
<br />
<tr><td>
<span id="range"></span>
</td></tr>
</table>
Comment