Board index » Visual Studio » Using a Dropdown Menu to show/hide table rows onChange
|
rquintana
|
Using a Dropdown Menu to show/hide table rows onChange
Visual Studio342
Hi - I'm having a difficult time manipulating the display property with VBScript in this instance. When the end user selects any of the dropdown options, some or all of the rows under it should be hidden. I've just posted here the code that is bothering me - the calculations themselves have worked just fine so I'll not fill up extra space. <html> <head> <title>Julian Day Calculator</title> <SCRIPT LANGUAGE="vbscript"> Sub frmMethod_onChange() with document.form1 'to show or hide (un)necessary table rows if .frmMethod.value = "Julian" then .Dayrow.style.display = "none" .Daterow.style.display = "none" else if .frmMethod.value = "Billing" then .Dayrow.style.display = "block" .Daterow.style.display = "none" Else .Dayrow.style.display = "none" .Daterow.style.display = "block" end sub </script> </Head> <FORM NAME="form1"><center> <table name="mytable"> <tr> <td align=right> <font size="2" face="Verdana, Arial, Helvetica, sans-serif">Enter a Date (MM/DD/YY): </font> </td> <td><INPUT TYPE="text" NAME="inputdate"> <a href="javascript:cal1.popup();"><img src="img/cal.gif" width="16" height="16" border="0" alt="Click Here to Choose the date"></a> </td><tr> <br> <tr> <td align=right><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Options: </font></td> <td> <SELECT NAME="frmMethod" SIZE="1"> <OPTION VALUE="Julian">Calculate Julian Day</OPTION> <OPTION VALUE="Billing">Calculate a future date by number of days</OPTION> <OPTION VALUE="Difference">Calculate the number of days between 2 dates</OPTION> </SELECT> </td></tr> <tr id="Dayrow"> <td align=right> <font size="2" face="Verdana, Arial, Helvetica, sans-serif">Number of days: </font> </td> <td> <INPUT TYPE="text" NAME="inputdays" Value=""> </td> </tr> <tr id="Daterow"> <td align=right> <font size="2" face="Verdana, Arial, Helvetica, sans-serif">Enter 2nd Date: </font> </td> <td> <INPUT TYPE="text" NAME="inputdate2" Value="MM/DD/YY"> <a href="javascript:cal2.popup();"><img src="img/cal.gif" width="16" height="16" border="0" alt="Click Here to Choose the date"></a> </td> </tr> </table> <BR> <INPUT TYPE="submit" NAME="cmdButton1" Value="Click HERE to calculate"></form> </body> </html> Any suggestions? I appreciate your help - |
