Click to See Complete Forum and Search --> : Dynamic Visible/Hidden Input Box


hilmesb
01-27-2003, 11:45 AM
I am looking for some JavaScript code that I can place in an ASP to be used with Netscape. The JavaScript code must be executed when a specific selection is made in a pulldown box. Based on the selection, the JavaScript will then display a blank text box for input.

For example: On a Form generated by ASP, I have a pulldown box. The pulldown contains the following values:

A, B, C, D.

If B is chosen, I need a blank text box to become visible and available for input. Otherwise, the text box remains hidden.

Thanks in advance for your help.

gil davis
01-27-2003, 11:46 AM
Originally posted by hilmesb
I am looking for some JavaScript code that I can place in an ASP to be used with Netscape.What version?

hilmesb
01-27-2003, 11:51 AM
Netscape Version 4.61.

gil davis
01-27-2003, 11:55 AM
NS 4 will not allow you to hide parts of forms. You can either

1. hide the whole form.

2. split the form into many forms and hide one (real pain to put it all back together for submission).

3. use document.write() to rebuild the form with the added field.

4. make two documents - one with the partial form and one with the whole form.

5. use the CLIP feature of a layer (hidden field must be last in form).

6. give up.

Here is an example of 5:

<ilayer name="l1" height=100 clip=0,0,600,50 bgcolor="teal">
<form name="MainForm" action="upload5.jsp" ENCTYPE="multipart/form-data" method="POST">
<input type="button" value="check" name="btnCheck1" onClick="window.document.layers.l1.clip.bottom=75">
<br>
<input type=submit value=submit>
<br>
<input type="file" name="file1"
</form>
</ilayer>
<p>More stuff