How can I hide a listbox with javascript. Have tried to hide the layer that the listbox resides on. No good. The layer hides but the listbox stays visible...
/Smirre
Printable View
How can I hide a listbox with javascript. Have tried to hide the layer that the listbox resides on. No good. The layer hides but the listbox stays visible...
/Smirre
Hi,
When you said that you couldn't get the layer to disappear when you put the form element in it, I though it was a bit strange because thats the method i use.
This code works for me...
Code:<html>
<head>
<title>Untitled</title>
</head>
<body>
<form name="form1">
<div id="layer1">
<select onmouseover="document.all('layer1').style.visibility='hidden'">
<option>vfger</option>
<option>vfger</option>
<option>vfger</option>
</select>
</div>
</form>
</body>
</html>
Have I missed something? Is document.all part of the standards?
Code:document.getElementByID("layer1").style.visibility="hidden"
Sorry, I missed that. Yeah, it should say getElementByID. The code uses all because I use that here at work where some of the browsers are IE4
"display:block" to "display:none" would also work, as "visibility:hidden" items should still take up space on the page.