Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6743931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:01:24+00:00 2026-05-26T12:01:24+00:00

This is probably an obvious mistake on my part. I have a C# page

  • 0

This is probably an obvious mistake on my part. I have a C# page that has a button that when clicked opens a calendar (ASP classic) in an iFrame. That calendar is passed the ClientID of the button as AddToCartButton and uses this line:

lo("parent.document.getElementById('" & AddToCartButton & "').style.display = 'none';")

(lo is a Response.Write type function and simply outputs the text to the page.)

to hide the button when the calendar appears. After the user selects a date the calendar uses a similar line to put the date into my C# textbox:

lo("parent.document.getElementById('" & PostBackField & "').value = '" & Replace(CurrentDate,":00 "," ") & "';")

This all works great but when I try to turn the button back on with:

lo("parent.document.getElementById('" & AddToCartButton & "').style.display = '';")

nothing happens. I have also tried ‘inline’ with similar non-results. Does anyone have an idea from what I’ve written here what I’m doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:01:24+00:00Added an answer on May 26, 2026 at 12:01 pm

    You should be using Visibility instead of display, but I can’t see why your code isn’t working with the display.

    lo("parent.document.getElementById('" & AddToCartButton & "').style.visibility = 'hidden';")
    

    and then

    lo("parent.document.getElementById('" & AddToCartButton & "').style.visibility ='visible'
    

    Setting the display to hidden removes the item from the flow, where visibility keeps the item in place, and just hides it, which I think is what you want.

    Here is a good article explaining the differences.

    Here is a quick sample I threw together.

        <html>
        <head>
        <script type="text/javascript">
        function show_button()
        {
           document.getElementById("targetBtn").style.visibility = 'visible';
        }
        function hide_button()
        {
           document.getElementById("targetBtn").style.visibility = 'hidden';
        }
        function remove_button()
        {
           document.getElementById("targetBtn").style.display = 'none';
        }
        </script>
        </head>
        <body>
        <input id="targetBtn" type="button" value="Button to Hide/Show" />
        <input type="button" onclick="show_button()" value="Show Button" />
        <input type="button" onclick="hide_button()" value="Hide Button" />
        <input type="button" onclick="remove_button()" value="Remove Button" />
    
        </body>
        </html>
    

    If you run this example, click the show and hide buttons. You’ll notice how they keep there place on the page. Click the remove button, and they will all shift to the left.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is probably obvious, so bear with me. YES, I KNOW THAT java.io.File has
Hey, so this is one of those questions that seems obvious, and I'm probably
This probably has a simple answer, but I must not have had enough coffee
This is probably a really obvious question, but it's driving me nuts. We have
This is probably obvious, but I'm a bit of a newbie and have spent
I'm new to Scala, so its probable that this is an incredibly obvious mistake.
This probably has a really obvious answer, but I can't seem to find it.
This is probably very obvious, in fact so obvious that no C++ reference I
The solution is probably obvious, but I do not see it. I have this
Sorry for posting something that's probably obvious, but I don't have much database experience.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.