Hi
I am trying to diplay a hidden List box when a check box is clicked and at the same time hide another text box.
Here's the code so far:
<SCRIPT language="VBScript">
Sub ChgDept()
If document.chkDept.value = 1 then
document.txtbox1.style.visibility = hidden
document.listbox1.style.visibility= visible
end if
end sub
</SCRIPT>
<FORM>
<INPUT size="20" type="text" name="txtbox1" value="<%= fieldname1%>" style="visibility:visible">
<SELECT size="1" name="lDept" style="visibility:hidden">
<OPTION>Select Department from the menu</OPTION>
<% While Not objrec2.EOF %>
<OPTION> <%= rs("fieldname2"%></OPTION>
<%objrec2.movenext
Wend %></SELECT>
<BR>
<INPUT type="checkbox" name="chkDept" value="1" onselect="ChgDept()"><BR>
</FORM>
It's not working any ideas Why????
I am trying to diplay a hidden List box when a check box is clicked and at the same time hide another text box.
Here's the code so far:
<SCRIPT language="VBScript">
Sub ChgDept()
If document.chkDept.value = 1 then
document.txtbox1.style.visibility = hidden
document.listbox1.style.visibility= visible
end if
end sub
</SCRIPT>
<FORM>
<INPUT size="20" type="text" name="txtbox1" value="<%= fieldname1%>" style="visibility:visible">
<SELECT size="1" name="lDept" style="visibility:hidden">
<OPTION>Select Department from the menu</OPTION>
<% While Not objrec2.EOF %>
<OPTION> <%= rs("fieldname2"%></OPTION>
<%objrec2.movenext
Wend %></SELECT>
<BR>
<INPUT type="checkbox" name="chkDept" value="1" onselect="ChgDept()"><BR>
</FORM>
It's not working any ideas Why????