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 7015937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:43:06+00:00 2026-05-27T22:43:06+00:00

I thought I had a solid plan to do this but somehow or the

  • 0

I thought I had a solid plan to do this but somehow or the other it is not working…
But what I did, I have a variable on a web page some where (this is an asp.net MVC application). Based on what this variable is, I will change the style of one of two div’s two visible and then remove the style attribute (I have both of those two divs with a style element set to “display:none”). Now the first one works but the second one does not? I keep getting a javascript error that tells me that an object is required (I would give you the exact error but my web server isn’t working for some reason).

  Activate/Deactivate Patient 
  <div id="deactivateNO" style="display:none"><%=Html.RadioButton("deactivate", "N", false)%>Deactivate</div>
  <div id="deactivateYES" style="display:none"><%=Html.RadioButton("deactivate", "A", false)%>Activate</div>

Those are the div’s that I have described with the radio buttons inside. What follows are the javascript functions I call to make one of those divs appear or disapear…

function ShowMessage() 
{
    var timer = setTimeout("Show()", 1200000);
    //debugger;
    var active = "<%= Active %>";
    if (active == "A")
    HideActivate();   
    if (active == "N")
    HideDeactivate();     
}

function HideActivate()
{
    //debugger;
    var obj = document.getElementById("deactivateNO");
    obj.style.visibility = 'visible';
    obj.removeAttribute('style');
}
function HideDeactivate() {
    //debugger;
    var obj = document.getElementById("deactivateYes");
    obj.style.visibility = 'visible';
    obj.removeAttribute('style');
}

The first function calls either of the final two functions. The first function seems to work well. The second function seems to be giving me trouble… When I have my debugger going, it always bugs out on the obj.style.visibility = ‘visible’; When I look at the obj object it is always null? Which tells me that it can’t find the deactivateYes Id? I have looked at the source and it appears as though it is there. I will double check, but I am pretty sure it is.

  • 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-27T22:43:06+00:00Added an answer on May 27, 2026 at 10:43 pm

    is deactivateYes and deactivateYES the same…

    this is why it will fail to find the element, the ids dont match

    have to really careful about case 😉

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

Sidebar

Related Questions

I thought I had this perfectly working but apparently not. I left my project
I thought I had this figured out but it turns out I'm just deleting
Alright, I thought I had this whole setTimeout thing perfect but I seem to
I thought I had the assets pipeline figured out, but not any more. I
I'm developing a PHP/HTML5/CSS3 page and have run into an issue. I somehow had
I had a web page that I thought had way too much content showing
This is just an idle thought I had when reading this other question: What
I thought I had got this to work before, but I just don't see
I thought I had my uploads working correctly on Friday, but when I tested
I thought I had this one pretty good, but I just keep running into

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.