Click to See Complete Forum and Search --> : Non-displayed <Select> support for Netscape 4.7x
olerag
11-04-2003, 09:11 AM
The following HTML does not work for me using Netscape
4.7x. Is there a work-around for this antequated browser?
The specific code is the "style" command in the <select> tag.
<html>
<head>
<title>Non-Displayed Selection</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<center>
<b>Non-Displayed Selection List</b>
<form action="" method="get">
<select size="3" name="hideSelect" multiple style="display: none;">
<option value="1" selected>Option 1</option>
<option value="2" selected>Option 2</option>
<option value="3" selected>Option 3</option>
<option value="4" selected>Option 4</option>
</select>
</form>
<hr>
Test for Non-Displayed Selection List
</center>
</body>
</html>
DaveSW
11-04-2003, 09:45 AM
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)
Aronya1
11-04-2003, 11:53 AM
Originally posted by olerag
<select size="3" name="hideSelect" multiple style="display: none;">
I'm ignorant about what that 'multiple' comment is supposed to do.
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.
gil davis
11-04-2003, 12:00 PM
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".
It works correctly in NN4.5, and NN4.0 shows a disabled empty select list.
Is NN4.7 different???
olerag
11-04-2003, 02:50 PM
Thanx all for your comments....
Gil - Don't want "layer" with later versions of IE and Netscape.
Dave - Disabling won't cut-it for this.
Aronya1 - it ain't the semi-colon.
Fang - I've only gone back as far as 4.7x (no 4.0 or 4.5).
The first time the page is called, its issued from another
page with a CGI command, however all subsequent calls
will simply call itself via a <form submit>. The original
CGI uses one arg name with multiple values. The only
HTML object that meets this is a <select> tag consequently
the object is only a storage area that has no user interaction
(reasoning for not displaying it). However, for each new
submit, the same info in the select gets passed. It worked
great for IE6 and Net7.
Anyway, I got it to work for all with a mess of "hiddens" and
the args are now independent names and an extra "count"
arg was also required (ugly).
The real question now becomes, for all those style folks,
DOESN'T EARLIER BROWSERS CAUSE A REAL PROBLEM?
Another "off the wall" "series" question. If 13% of browser
users don't use Javascript then....
a) What percent of users use an earlier version of IE?
b) What percent use earlier versions of Netscape?
c) What percent use a third-brand browser?
d) What percent are considered handicapped?
gil davis
11-04-2003, 05:38 PM
Originally posted by olerag
The first time the page is called, its issued from another
page with a CGI command, however all subsequent calls
will simply call itself via a <form submit>. The original
CGI uses one arg name with multiple values. The only
HTML object that meets this is a <select> tag consequently
the object is only a storage area that has no user interaction
(reasoning for not displaying it).
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.
<input type="hidden" name="hideSelect" value="1">
<input type="hidden" name="hideSelect" value="2">
<input type="hidden" name="hideSelect" value="3">
<input type="hidden" name="hideSelect" value="4">
I think you'll find that this gives the same results.
olerag
11-05-2003, 10:46 AM
Thanx Gil,
I will try this as I was unaware multi "hiddens" could have
the same name.
If this works OK I will need to figure out Javascript
iteration of this object. For a <select> its easy to examine
all "options". For this usage I suppose the same object
will be reexamined - such as snippet example below,
for (var i=0; i<forms.elements.length; i++) {
obj = form.elements[i];
if (obj.type == "hidden") {
if (obj.name == "hideSelect") {
myValue = myValue + " " + obj.value;
}
}
}
Using your HTML example, does it seem reasonable that
four (4) iterations will occur or only one??
gil davis
11-05-2003, 01:37 PM
When more than one form element has the same name, an object InputArray is created. For example, in my suggestion:
document.forms[0].hideSelectis an array with a length of four. Thus:
document.forms[0].hideSelect[0].value
document.forms[0].hideSelect[1].value
document.forms[0].hideSelect[2].value
document.forms[0].hideSelect[3].value
Or using a "for" loop:
for (var i=0; i<document.forms[0].hideSelect.length; i++;) {
document.forms[0].hideSelect[i].value = whatever;
}