View Full Version : #$*&(@*&! Netscape!!
I'm working on a data entry/reporting web site that needs to be functional in Netscape 4.7, 6.2 and IE 5.x. I'm going nuts with the things I have to change to get it to even display right on 4.7. N6.2 isn't so bad but there are some formatting issues.
Does anyone have any tips, hints, guiding forces that will help me with this??? There are lots of forms b/c of it being a data entry site. It is for a non-profit govt agency so I have to make it ADA (American Disabilities Act) compliant as well.
The biggest thing I have right now is hiding textboxes. I have the boxes coded like "< input type="textbox" style="VISIBILITY: hidden;" >. In N6.2, it hides the boxes. In N4.7, it shows them.
Thanks for any help.
Dia
Vladdy
09-06-2002, 07:05 PM
if (Browser=="Netscape" && Version<6.0)
alert("Your browser is outdated, upgrade required")
Here is the link that should help with ADA compliance
http://www.w3.org/TR/REC-CSS2/aural.html
Roy Sinclair
09-06-2002, 08:05 PM
You cannot hide form fields in Netscape 4. Think in terms of "degrading gracefully" for Netscape 4 instead of trying to make that antique pig of a browser match the newer browsers (which it can't and won't).
brothercake
09-06-2002, 11:05 PM
Originally posted by Roy Sinclair
You cannot hide form fields in Netscape 4.
Yeah you can
<html><head></head><body>
<div id="formDiv" style="position:relative">
<form>
<select>
<option>xxx xxx xxx</option>
<option>xxx xxx xxx</option>
<option>xxx xxx xxx</option>
<option>xxx xxx xxx</option>
</select>
</form>
</div>
<script language="javascript">
function hideFormDiv() {
if(document.layers) {
document.layers["formDiv"].visibility = "hide";
}
else if (document.all) {
document.all["formDiv"].style.visibility = "hidden";
}
else if (document.getElementById) {
document.getElementById("formDiv").style.visibility = "hidden";
}
}
</script>
<p><a href="java script:hideFormDiv()">hideFormDiv()</a>
</body></html>
Roy Sinclair
09-06-2002, 11:19 PM
Originally posted by brothercake
Yeah you can
...
No, you can't. You can hide a whole layer and that layer can contain a form (not a form field, it must be a whole form) but you cannot hide a single form field.
Of course you can put all the fields you want to hide inside layers but then you also have to extract the data from those fields and place their values into the real form when you submit.
The bottom line is that's a lot of extra coding just to handle one really, really, really defective browser. I prefer "degrading gracefully" to excessive coding.
adios
09-06-2002, 11:25 PM
As observed, you can certainly do this in Navigator. I've done it any number of times. My advice: don't! (unless you have no choice). Here's why: NS4 Layers, necessary to show/hide elements, have their own (sub-)documents; HTML forms can't 'straddle' documents; so, you'll need to put every hideable field in its own <form></form> container, in its own <layer></layer> and - if you want it relatively positioned, inside an additional <ilayer></ilayer> wrapper. Heard enough? There's more: now you've got forms galore; you'll need to gather the data into one big 'hidden' form and submit that.
No sense name-calling - this is an ancient (1997) item, built well before the current W3C specs were agreed on; it is what it is. As noted - the above is doable; if you try it, forget about cross-browsering and use server or client-side detects to deliver a NS4-specific page to the user.
<html>
<head>
<title>untitled</title>
<script type="text/javascript" language="javascript">
function show(id) {
document[id].document.layers[0].visibility = 'show';
}
function hide(id) {
document[id].document.layers[0].visibility = 'hide';
}
function setThis(f) {
var el;
for (var i=0; i<document.layers.length; ++i) {
el = document.layers[i].document.layers[0].document.forms[0].elements[0];
f.elements[el.name].value = el.value;
}
}
function uncheckem() {
for (var f=0; f<document.forms.length; ++f)
for (var e=0; e<document.forms[f].length; ++e)
if (document.forms[f].elements[e].type == 'checkbox')
document.forms[f].elements[e].checked = false;
}
onload = uncheckem;
</script>
</head>
<body>
<table>
<tr>
<td>
<form>
<input type="checkbox" onclick="this.checked?show('t1'):hide('t1')"> show t1
</form>
</td>
<td><ilayer id="t1">
<layer visibility="hide">
<form>
<input name="t1" type="text">
</form>
</layer></ilayer></td>
</tr>
<tr>
<td>
<form>
<input type="checkbox" onclick="this.checked?show('t2'):hide('t2')"> show t2
</form>
</td>
<td><ilayer id="t2">
<layer visibility="hide">
<form>
<input name="t2" type="text">
</form>
</layer></ilayer></td>
</tr></table>
<!-- hidden fieldnames same as 'layered' fieldnames -->
<form name="hiddenForm" method="get" onsubmit="setThis(this)">
<input name="t1" type="hidden">
<input name="t2" type="hidden">
<input type="submit" value="DONE">
</form>
</body>
</html>
brothercake
09-07-2002, 02:55 AM
I merely meant to point out that it can be done, as it can.
Netscape 4 may suck and blow at the same time ... but in it's day it was king. Netscape 4 can do things that still no browser since can do.
Okay since hiding form fields in N4 is not a good idea how else can I "hide" values on the page that correspond uniquely to each row that will show? Think spreadsheet effect for the form with each row requiring an identifier that is of no value to the user therefore no need to show.
Thanks,
Dia
ANother question for you....
Both versions of netscape seem to totally ignore the following code:
<SCRIPT LANGUAGE="VBSCRIPT">
sub B1_onClick
dim x, i
x=""
for i=0 to document.frmMetricsSelect.Metricused.length-1
if document.frmMetricsSelect.Metricused(i).checked=true then
x= x & document.frmMetricsSelect.metricused(i).value & ","
end if
next
document.frmMetricsSelect.action="ProcessSubmitMetrics.asp?FY=" & <%=intFY%> & "&MetricsSelected=" & Mid(x,1,len(x) -1)
End Sub
</SCRIPT>
I know most of you here are js people but I just have't gotten that under my belt yet. This code works fine in IE. Why does Netscape totally disregard it? The code is behind the submit button for the form.
Quiet Storm
09-09-2002, 05:36 PM
Originally posted by brothercake
Netscape 4 can do things that still no browser since can do.
LOL!!
Like crash on page enter! :D
LOL!
I was just informed by a coworker that the reason my code doesn't run is b/c netscape doesn't interpret any client-side vbs. So I ask, are any good sources out there that you can point me to that will help me learn how to turn my vbs into js for netscape?
Thanks,
Dia
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.