/    Sign up×
Community /Pin to ProfileBookmark

Hiding a form in Netscape

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!!!!

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@GollumJul 18.2003 — 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?

[CODE]
<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();

}

[/CODE]
Copy linkTweet thisAlerts:
@GremlinsauthorJul 18.2003 — i just tried it and in Netscape does not show what's inside the <span> tags
Copy linkTweet thisAlerts:
@gil_davisJul 19.2003 — 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.
Copy linkTweet thisAlerts:
@CharlesJul 19.2003 — [font=georgia]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.[/font]
Copy linkTweet thisAlerts:
@GremlinsauthorJul 22.2003 — well i'm not too worried, but hey, i'd like to make the netscape users happy too ya know ?
×

Success!

Help @Gremlins spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...