Im work on a form that will dynamicly display objects. The form is completed and working but am adding some features that will appear based on the user selection. I am unable to get the onchange event to work. When I make the selection in the drop down nothing happens. Any help would be great thanks.
Once the user selects the choice I want it to check if it matchs. If it does then to make an object visible.
The selection the user will make there choice.
The choice that will become visible.
-John
Code:
<script language="JavaScript">
function showHideContent( id, show )
{
var elem = document.getElementById( id );
if ( elem )
{
if ( show )
{
elem.style.display = 'block';
elem.style.visibility = 'visible';
}
else
{
elem.style.display = 'none';
elem.style.visibility = 'hidden';
}
}
}
Code:
function ModSelection( selection )
{
if ( selection == "Split Case Pick" )
{
showHideContent( 'SCP1', true);
}
else
showHideContent( 'SCP1', false);
}
}
</script>
Code:
<div id="Form1">
<table width="80%" align="center">
<tr>
<td width="18%" align="center">
<font face="Arial" size="2">
<label>From Department: </label>
<% Response.Write( "<select name=""FDepartment1"" onchange=""ModSelection(this.options[this.selectedIndex].value)"" tabindex=""3"">" )
For a = 0 To UBound( mySQLDepList, 2 )
For b = 0 To UBound( mySQLDepList, 1 )
Response.Write("<option value='" & mySQLDepList(b, a) & "'>" & mySQLDepList(b, a) & "</option>" & vbCr)
Next
Next
Response.Write("</select>" ) %>
</font>
</td>
</tr>
</table>
</div>
Code:
<div style="display:none" id="SCP1"> <td><select name="SCPSelection"> <option value="M Mod">M Mod</option> <option value="L Mod">L Mod</option> </select></td> </div>
-John
Comment