Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I hide controls in a form? 1

Status
Not open for further replies.

Ditter

Programmer
Sep 11, 2000
16
0
0
FR
I'm looking for tecniques for hiding controls in a form, I'm not quite sure if it is posible...

For example, if a RADIO button is pressed, make invisible a SELECT or something like this.

Can I do that? How?
 
In IE (i'm testing in 5.5) you can just access it my name or id and say nameofbox.style.visibility='hidden'

otherwise, for older versions and for netscape, you may have to put it inside a layer and hide the layer, but I'm not sure jared@aauser.com
 
no it's only that for netscape the syntax isn't the same
i'm not 100% sure but i remember it's not "hidden" but "hide"
 
for IE the two strings to use are:

visibile/hidden

NS i think:

hide/show jared@aauser.com
 
Hi all

This one's giving me a headache too. I am wanting to dynamically hide and view a couple of combo boxes, depending on the value selected in a third combo box, which is no problem under IE but I am trying all kinds of things under Netscape. I tried putting the combo boxes on a layer but Netscape (I am testing on 4.74) doesn't seem to like it - I get the text from each of the options displayed in a layer instead of getting the combo boxes. I seem to recall that combo boxes are implemented as separate window objects, so maybe they are incompatible with layers other than the base layer.

Has anyone managed to do this?

EARTHDWELLER, Yorkshire, England
 
i remember a thread of someone who add almost the same problem, but he had the combo in a table cell
i don't remember the forum, the thread number, nor the answer .... sorry i'm afraid i'm not a great help for you !! but you should perform a search in this forum ...
 
this works in NS6:

<form>
<select name=&quot;don&quot;>
<option value=&quot;a&quot;>aaaa
<option value=&quot;b&quot;>bbbb
</select>

<select name=&quot;don1&quot;>
<option value=&quot;a&quot;>aaaa
<option value=&quot;b&quot;>bbbb
</select>

<select id=&quot;don2&quot; onChange=&quot;this.form.don.style.visibility='hidden';this.form.don1.style.visibility='hidden'&quot;>
<option value=&quot;a&quot;>aaaa
<option value=&quot;b&quot;>bbbb
</select>

</form> jared@aauser.com
 
Thanks for the example Jared. In NN4.74 the onChange gives the JavaScript error &quot;this.form.don.style has no properties&quot;. NN6 is implementing the new style DOM. Your example also works in IE5.00.2314.1003 . As my page is destined for the web rather than intranet, version 4 browser upwards, I am still looking for an NN4 solution. For the time being I am putting some not applicable &quot;n/a&quot; entries as the last option in the combo boxes and if NN4 I am flipping the combo values to &quot;n/a&quot; at the point where I would really prefer to hide them altogether.

EARTHDWELLER
 
Hi,

Did you find a solution? I would like to show/hide a couple input cols based on a radio button. Please post your solution if you found one...

Thanks,

Computergeek
 
This is a blast from the past - I had completely forgotten about it. No I didn't find a solution, so left it as described above. Personally I wouldn't bother too much about NN4.7 any more unless you have a NN4.7 intranet or are particularly attracting NN4.7 traffic. Analysis of traffic to one of my websites suggests that hardly anyone is using NN4 any more (only a couple of visitors this year).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top