P
Paul Lautman
Hi y'all,
I found the toggle function (shown below) and applied it to a form of mine.
It works fine in IE, but in Firefox it appears to fail on the eval lines.
I've searched around but I can't seem to find the correct invocation to get
the field to appear in Firefox.
I've copied below the call and the html of the field itself.
Can anyone point me to what is wrong with it and more to the point, how to
get it working?
TIA
Regards
Paul
toggleT('divt1','s');
function toggleT(_w,_h) {
if (document.all) { // is IE
if (_h=='s') eval("document.all."+_w+".style.visibility='visible';");
if (_h=='h') eval("document.all."+_w+".style.visibility='hidden';");
} else { // is NS?
if (_h=='s') eval("document.layers['"+_w+"'].visibility='show';");
if (_h=='h') eval("document.layers['"+_w+"'].visibility='hide';");
}
<span id="divt1" style="visibility:hidden;position:relative;top:0;left:0">
<label for="other">Please specify where you heard about us:</label>
<input type="text" size="40" name="other" id="other">
</span>
I found the toggle function (shown below) and applied it to a form of mine.
It works fine in IE, but in Firefox it appears to fail on the eval lines.
I've searched around but I can't seem to find the correct invocation to get
the field to appear in Firefox.
I've copied below the call and the html of the field itself.
Can anyone point me to what is wrong with it and more to the point, how to
get it working?
TIA
Regards
Paul
toggleT('divt1','s');
function toggleT(_w,_h) {
if (document.all) { // is IE
if (_h=='s') eval("document.all."+_w+".style.visibility='visible';");
if (_h=='h') eval("document.all."+_w+".style.visibility='hidden';");
} else { // is NS?
if (_h=='s') eval("document.layers['"+_w+"'].visibility='show';");
if (_h=='h') eval("document.layers['"+_w+"'].visibility='hide';");
}
<span id="divt1" style="visibility:hidden;position:relative;top:0;left:0">
<label for="other">Please specify where you heard about us:</label>
<input type="text" size="40" name="other" id="other">
</span>