|
-
Apr 9th, 2002, 01:38 AM
#1
Thread Starter
Hyperactive Member
Hide listbox with javascript??
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
Visual Basic
C, C++
Java
Access
SQL Server
MCP, MCSD
-
Apr 9th, 2002, 03:23 AM
#2
Fanatic Member
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>
-
Apr 9th, 2002, 09:23 AM
#3
Frenzied Member
Have I missed something? Is document.all part of the standards?
Code:
document.getElementByID("layer1").style.visibility="hidden"
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Apr 9th, 2002, 10:28 AM
#4
Fanatic Member
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
-
Apr 9th, 2002, 11:02 AM
#5
Black Cat
"display:block" to "display:none" would also work, as "visibility:hidden" items should still take up space on the page.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|