|
-
May 23rd, 2005, 11:14 PM
#1
Thread Starter
Hyperactive Member
Visibility scripting problems with VBScript
Alright, I made a table of contents page that has a few invisible div elements that hold links for the code examples for each section. My question is this, what am I doing wrong here? Here is the HTML for the div element to make it invisible:
Code:
<div id = "div1" style = "position:absolute; width:300px; height;100px; visibility:hidden;">
I think this is right. Now, here is the VBScript to control the visibility of the div element:
Code:
Sub Examples1_onclick
'Show the invisible div layer and change the caption of the button
div1.style.visibility = visible
Examples1.value = "Hide Examples"
End Sub
The script is incomplete but I am going to use a check on the value of the button to determine whether or not to hide or show the div element. Another thing too is that when I run the page with this script and click on the button, I get this error message:
variable is undefined: visible
Does this have something to do with the fact that I used Option Explicit in my VBScript? Thanks for any help!
Last edited by GamerMax5; May 24th, 2005 at 03:39 PM.
-
May 23rd, 2005, 11:52 PM
#2
Junior Member
Re: Visibility scripting problems with VBScript
use the following
Code:
div1.style.visibility = "visible"
-
May 24th, 2005, 03:39 PM
#3
Thread Starter
Hyperactive Member
Re: Visibility scripting problems with VBScript
Wow. Really dumb mistake on my part. Thanks dude.
-
Dec 16th, 2007, 06:36 PM
#4
New Member
Re: Visibility scripting problems with VBScript
Similair problem,
Writing a page in ASP which contains the code:
<%@ Language="VBScript" %>
<head>
<%
Sub HideTable()
HideButton.style.visibility = "hidden" <-- Line 12
end sub
%>
</head>
<body>
<button id="HideButton" style="visibility:visible;" value="Hide Table">
</body>
The error I recieve on load is :
Object required: 'HideButton'
****/****.asp, line 12
What have I done wrong, the code is pretty simple.
Any help appreciated ~ Vitus
-
Dec 17th, 2007, 02:32 PM
#5
Thread Starter
Hyperactive Member
Re: Visibility scripting problems with VBScript
Code:
<button id="HideButton" style="visibility:visible;" value="Hide Table">
Shouldn't that be an input tag with a type of button and not a button tag?
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
|