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! :confused:
Re: Visibility scripting problems with VBScript
use the following
Code:
div1.style.visibility = "visible"
Re: Visibility scripting problems with VBScript
Wow. Really dumb mistake on my part. Thanks dude.
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
Re: Visibility scripting problems with VBScript
Quote:
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?