Click to See Complete Forum and Search --> : Hiding a form in Netscape
Gremlins
07-18-2003, 07:35 AM
I have a little script which hides text fields in a form, it works great in explorer and opera but not in netscape!!!
it looks something like this:
function showDiv1( id ) {
document.all.textBox02.style.visibility = 'hidden';
document.all.textBox02.value = '';
document.all[ id ].style.visibility = 'visible';
document.all[ id ].focus();
}
this hides the 2 text field and makes the 1st visible (radiobuttons are used to click them on and off).
The tag is:
<input type="radio" name=radioBtn onClick="showDiv1( 'textBox01' );">
If anyone knows how to make it work in Netscape HELP!!!!
Gollum
07-18-2003, 08:05 AM
That looks like the right kind of terminology, though I'm not sure it works so well on text boxes.
have you considered placing the text boxes inside <div> or <span> tags and makeing that hidden or visible instead?
<span id=span02><input type=text name=textBox02></span>
then
function showDiv1(id)
{
document.getElementById("spantextBox02").style.visiblity = "hidden";
document.all.textBox02.value = '';
document.getElementById("span" + id ).style.visiblity = "visible";
document.all[ id ].focus();
}
Gremlins
07-18-2003, 08:13 AM
i just tried it and in Netscape does not show what's inside the <span> tags
gil davis
07-19-2003, 01:37 PM
You did not say what version of Netscape. However, no version of Netscape will support document.all.
In NS 4, you cannot show/hide individual form elements, because in order to script anything, it must be a positioned element. Doing that takes the element out of the form and then the form breaks. The elements themselves do not have a "visibility" attribute that does anything.
Charles
07-19-2003, 01:47 PM
Actually it doesn't work for all MSIE users. About 93% of users use MSIE 4 or 5 but only 87% of users use JavaScript. That means that at least 6% of users are using MSIE with the scripting diasabled,but it's likely twice that. Netscape 5, 6 and 7 users represent 3% of the users and Opera another 1%. In other words, why on earth are you worried about those few measly Netscape users when your page falls flat on its face for so many other users? Make a page that works as well with as without JavaScript and then don't worry about it.
Gremlins
07-22-2003, 05:54 AM
well i'm not too worried, but hey, i'd like to make the netscape users happy too ya know :)