Results 1 to 5 of 5

Thread: Visibility scripting problems with VBScript

  1. #1

    Thread Starter
    Hyperactive Member GamerMax5's Avatar
    Join Date
    Nov 2004
    Location
    United States
    Posts
    388

    Resolved 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.
    Only those who try will become.

    Find me on identi.ca

    Twitter @gfmartin05

    Linux Wrap

  2. #2
    Junior Member Mackster's Avatar
    Join Date
    Apr 2005
    Posts
    24

    Re: Visibility scripting problems with VBScript

    use the following
    Code:
    div1.style.visibility = "visible"

  3. #3

    Thread Starter
    Hyperactive Member GamerMax5's Avatar
    Join Date
    Nov 2004
    Location
    United States
    Posts
    388

    Re: Visibility scripting problems with VBScript

    Wow. Really dumb mistake on my part. Thanks dude.
    Only those who try will become.

    Find me on identi.ca

    Twitter @gfmartin05

    Linux Wrap

  4. #4
    New Member
    Join Date
    Aug 2006
    Posts
    2

    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

  5. #5

    Thread Starter
    Hyperactive Member GamerMax5's Avatar
    Join Date
    Nov 2004
    Location
    United States
    Posts
    388

    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
  •  



Click Here to Expand Forum to Full Width