Click to See Complete Forum and Search --> : Hide listbox with javascript??
Smirre
Apr 9th, 2002, 01:38 AM
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
punkpie_uk
Apr 9th, 2002, 03:23 AM
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...
<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>
CiberTHuG
Apr 9th, 2002, 09:23 AM
Have I missed something? Is document.all part of the standards?
document.getElementByID("layer1").style.visibility="hidden"
punkpie_uk
Apr 9th, 2002, 10:28 AM
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
JoshT
Apr 9th, 2002, 11:02 AM
"display:block" to "display:none" would also work, as "visibility:hidden" items should still take up space on the page.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.