cracken
04-18-2008, 10:38 PM
Hi
I have the following JavaScript which does not work in Firefox, could anyone advise me how to get this to work. Works fine in IE.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type=text/javascript>
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';");
}
}
</script>
</head>
<body>
<form>
Property Type ? (moving from)*<br />
<input name="propertyType" type="radio" value="House" onClick="toggleT('divt1','h')" />House
<input name="propertyType" type="radio" value="Flat" onClick="toggleT('divt1','s')"/>Flat
<span id="divt1" style="visibility:hidden;position:relative;top:0;left:0">
<input type="text" size="1" on /> Floor</span>
</form>
</body>
</html>
Any input would be much app.
Thanks in advance.
Mark :)
I have the following JavaScript which does not work in Firefox, could anyone advise me how to get this to work. Works fine in IE.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type=text/javascript>
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';");
}
}
</script>
</head>
<body>
<form>
Property Type ? (moving from)*<br />
<input name="propertyType" type="radio" value="House" onClick="toggleT('divt1','h')" />House
<input name="propertyType" type="radio" value="Flat" onClick="toggleT('divt1','s')"/>Flat
<span id="divt1" style="visibility:hidden;position:relative;top:0;left:0">
<input type="text" size="1" on /> Floor</span>
</form>
</body>
</html>
Any input would be much app.
Thanks in advance.
Mark :)