Non-displayed <Select> support for Netscape 4.7x

liunx

Guest
The following HTML does not work for me using Netscape<br />
4.7x. Is there a work-around for this antequated browser?<br />
The specific code is the "style" command in the <select> tag.<br />
<br />
<br />
<html><br />
<head><br />
<title>Non-Displayed Selection</title><br />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><br />
</head><br />
<body><br />
<center><br />
<b>Non-Displayed Selection List</b><br />
<form action="" method="get"><br />
<select size="3" name="hideSelect" multiple style="display: none;"><br />
<option value="1" selected>Option 1</option><br />
<option value="2" selected>Option 2</option><br />
<option value="3" selected>Option 3</option><br />
<option value="4" selected>Option 4</option><br />
</select><br />
</form><br />
<hr><br />
Test for Non-Displayed Selection List<br />
</center><br />
</body><br />
</html><!--content-->Well disabled="disabled" works to an extent, but that may mess up your page for everything else (I presume the list is displayed at some point)<!--content-->Originally posted by olerag <br />
<select size="3" name="hideSelect" multiple style="display: none;"> <br />
I'm ignorant about what that 'multiple' comment is supposed to do.<br />
I assume the list is being displayed, & you don't want it to, right? The only thing that suggests itself to me is the semicolon after 'none.' Try removing it.<!--content-->The best you can hope for is to enclose the entire form in a layer or div and specify "visibility: hidden". This will hide the entire form, but does not take the form out of the flow of the document like "display: none" does on other browsers. NS 4 only partly supports "display".<!--content-->It works correctly in NN4.5, and NN4.0 shows a disabled empty select list.<br />
Is NN4.7 different???<!--content-->Thanx all for your comments....<br />
<br />
Gil - Don't want "layer" with later versions of IE and Netscape.<br />
Dave - Disabling won't cut-it for this.<br />
Aronya1 - it ain't the semi-colon.<br />
Fang - I've only gone back as far as 4.7x (no 4.0 or 4.5).<br />
<br />
The first time the page is called, its issued from another<br />
page with a CGI command, however all subsequent calls<br />
will simply call itself via a <form submit>. The original<br />
CGI uses one arg name with multiple values. The only<br />
HTML object that meets this is a <select> tag consequently<br />
the object is only a storage area that has no user interaction<br />
(reasoning for not displaying it). However, for each new<br />
submit, the same info in the select gets passed. It worked<br />
great for IE6 and Net7.<br />
<br />
Anyway, I got it to work for all with a mess of "hiddens" and<br />
the args are now independent names and an extra "count"<br />
arg was also required (ugly).<br />
<br />
The real question now becomes, for all those style folks,<br />
DOESN'T EARLIER BROWSERS CAUSE A REAL PROBLEM?<br />
<br />
Another "off the wall" "series" question. If 13% of browser<br />
users don't use Javascript then....<br />
<br />
a) What percent of users use an earlier version of IE?<br />
b) What percent use earlier versions of Netscape?<br />
c) What percent use a third-brand browser?<br />
d) What percent are considered handicapped?<!--content-->Originally posted by olerag <br />
The first time the page is called, its issued from another<br />
page with a CGI command, however all subsequent calls<br />
will simply call itself via a <form submit>. The original<br />
CGI uses one arg name with multiple values. The only<br />
HTML object that meets this is a <select> tag consequently<br />
the object is only a storage area that has no user interaction<br />
(reasoning for not displaying it).<br />
Ever consider using the <INPUT TYPE="HIDDEN">? If you name the boxes correctly, you will get the same information submitted to your CGI, and you can put away your sledge hammer. It is also cross-browser, free of charge.<br />
<br />
<input type="hidden" name="hideSelect" value="1"><br />
<input type="hidden" name="hideSelect" value="2"><br />
<input type="hidden" name="hideSelect" value="3"><br />
<input type="hidden" name="hideSelect" value="4"><br />
<br />
I think you'll find that this gives the same results.<!--content-->Thanx Gil,<br />
<br />
I will try this as I was unaware multi "hiddens" could have<br />
the same name.<br />
<br />
If this works OK I will need to figure out Javascript<br />
iteration of this object. For a <select> its easy to examine<br />
all "options". For this usage I suppose the same object<br />
will be reexamined - such as snippet example below,<br />
<br />
<br />
for (var i=0; i<forms.elements.length; i++) {<br />
obj = form.elements;<br />
if (obj.type == "hidden") {<br />
if (obj.name == "hideSelect") {<br />
myValue = myValue + " " + obj.value;<br />
}<br />
}<br />
}<br />
<br />
<br />
Using your HTML example, does it seem reasonable that<br />
four (4) iterations will occur or only one??<!--content-->When more than one form element has the same name, an object InputArray is created. For example, in my suggestion:<br />
document.forms[0].hideSelectis an array with a length of four. Thus:<br />
document.forms[0].hideSelect[0].value<br />
document.forms[0].hideSelect[1].value<br />
document.forms[0].hideSelect[2].value<br />
document.forms[0].hideSelect[3].value<br />
Or using a "for" loop:<br />
for (var i=0; i<document.forms[0].hideSelect.length; i++;) {<br />
document.forms[0].hideSelect.value = whatever;<br />
}<!--content-->
 
Back
Top