Hide&Show field on web 2

Hi!I try hide and show fields by:


For a fast hide-when …

Put

around the area to be hidden.

Then click a button or a checkbox or whatever

onClick = document.all[ “name” ].style.display = “none”;

… and its complement …

onClick = document.all[ “name” ].style.display = “block”;

(Modify as needed to suit your browser.)


It work well, when i set instead of “document.all[ “name” ].style.display = “none””, i set “document.forms[0].name_field.style.display = “none”;”

First example - doesn’t work.

2 example work good, but i want to hide my field, when doc is open. If i set in

instead of “block” - “none”, this make nothing. Field is shown. Why?


I try 2 way, too.

put this in the JS Header:

form = document.forms[0];

ns4 = (document.layers)? true:false

ie4 = (document.all)? true:false

// Show/Hide functions for non-pointer layer/objects

function show(id) {

if (ns4) document.layers[id].visibility = “show”

else if (ie4) document.all[id].style.display = “inline”

}

function hide(id) {

if (ns4) document.layers[id].visibility = “hide”

else if (ie4) document.all[id].style.display = “none”

}

Put this around the field or collection of fields that you wish to hide

field or collection of fields

put this in your hotspot

show(“timeschedule”);

or

hide(“timeschedule”);

This case doesn’t work in my form.Why?

Subject: Hide&Show field on web 2

I use to hide:

document.getElementById(divname).style.display=“none”

to show:

document.getElementById(divname).style.display=“inline”

Subject: RE: Hide&Show field on web 2

Where you set “document.getElementById(divname).style.display=“none””?You set

, too?

Subject: RE: Hide&Show field on web 2

function hideStuff(divName){document.getElementById(divName).style.display=“none”;

}

function showStuff(divName){

document.getElementById(divName).style.display=“inline”;

}

in HTML doc

text text
text text

then call the function when you wish to hide

example onLoad

showStuff(“myDiv1”);

showStuff(“myDiv2”);