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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:53:29+00:00 2026-06-17T12:53:29+00:00

I swear I’m going to learn more JavaScript… I have this page (which really

  • 0

I swear I’m going to learn more JavaScript…

I have this page (which really an include file in another ASP page, but I copied the correct HTML and made it so it’d load by itself for my testing purposes):

FO Samples

This is how it should show when they first load it. If they choose one of the other radio buttons, it should HIDE the 2 dropdown boxes. Using this code (something I found from someone else’s question on here), its working.

<script type="text/javascript">
    function ChangeDropdowns(value) {
        if (value == "0") {
            document.getElementById('SAMPLEDROPDOWN').style.display = 'block';
        } 
        else  {
            document.getElementById('SAMPLEDROPDOWN').style.display = 'none';
        }        
    }
</script>

But I can’t figure out how to make it show them again if they go back to the “I wanna pick my own!” radio. The value of SAMPGROUP is the ID from the database of that sample category group. So it won’t necessarily be in numerical order, it might skip #’s (if we delete a category or something). Basically, it should show the dropdowns if SAMPGROUP = 0 and not if its anything else!

I tried changing my code to this (95 being the value of SAMPGROUP for the “Autumm” option), but it doesn’t seem to have made a difference.

<script type="text/javascript">
    function ChangeDropdowns(value) {
        if (value == "0") {
            document.getElementById('SAMPLEDROPDOWN').style.display = 'block';
        } else if (value == "95") {
        document.getElementById('SAMPLEDROPDOWN').style.display = 'none';
    }
    else  {
        document.getElementById('SAMPLEDROPDOWN').style.display = 'none';
    }        
    }
</script>

Any help would be greatly appreciated!!

Mahalo!

  • 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-06-17T12:53:31+00:00Added an answer on June 17, 2026 at 12:53 pm

    You are not setting the “value” in your onchange event, thus it’s never equal to 0. Try changing this:

    <input type="radio" name="SAMPGROUP" value="0" OnChange="Javascript:ChangeDropdowns()" checked />
    

    to

    <input type="radio" name="SAMPGROUP" value="0" OnChange="Javascript:ChangeDropdowns(0)" checked />
    

    Here is the fiddle.

    Good luck.

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

Sidebar

Related Questions

I swear, I have this exact thing working on another page. I'm such a
I swear this was working last night which was why I was able to
I swear this doesn't make sense. Given I have this HttpRouteCollection from Web API,
I swear... i hope this is the last question I have to ask like
I swear I have poured and poured over every other similar question on this
Some days I swear I'm going mad. This is one of those days. I
I swear I have seen this done before but can not find it now.
Apologies if this is a really common and/or ridiculous question; I swear I've read
I swear I have seen an example of this but have been googling for
I swear this used to work. I am trying to do breadcrumbs. I have

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.