chelentano
02-21-2003, 09:39 PM
I am trying the fieldlayer to be visible when list options are selected (value 1) and I want to show forgroundlayer (initially visible) when no selection been made. I know my Javascript is messed up. Please help!
<html>
<head>
<title>Untitled Document</title>
<script language="JavaScript">
<!--
function checkValue() {
if field select="1" {
document.all.fieldlayer.style.visibility = "visible"
} else {
document.all.forgroundlayer.style.visibility = "hidden"
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="forgroundlayer" style="position:absolute; left:180px; top:285px; width:111px; height:27px; z-index:10; visibility: visible; background-color: #0099FF; layer-background-color: #0099FF; border: 1px none #000000" onMouseDown="checkValue()" >
</div>
<div id="fieldlayer" style="position:absolute; left:180px; top:285px; width:138px; height:32px; z-index:9; visibility: hidden" onMouseDown="checkValue()">
<select name="select" >
<option value="0"></option>
<option value="1">red apples</option>
<option value="1">green grapes</option>
<option value="1">watermelons</option>
</select>
</div>
</body>
</html>
<html>
<head>
<title>Untitled Document</title>
<script language="JavaScript">
<!--
function checkValue() {
if field select="1" {
document.all.fieldlayer.style.visibility = "visible"
} else {
document.all.forgroundlayer.style.visibility = "hidden"
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="forgroundlayer" style="position:absolute; left:180px; top:285px; width:111px; height:27px; z-index:10; visibility: visible; background-color: #0099FF; layer-background-color: #0099FF; border: 1px none #000000" onMouseDown="checkValue()" >
</div>
<div id="fieldlayer" style="position:absolute; left:180px; top:285px; width:138px; height:32px; z-index:9; visibility: hidden" onMouseDown="checkValue()">
<select name="select" >
<option value="0"></option>
<option value="1">red apples</option>
<option value="1">green grapes</option>
<option value="1">watermelons</option>
</select>
</div>
</body>
</html>