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

  • Home
  • SEARCH
  • 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 1069351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:24:41+00:00 2026-05-16T20:24:41+00:00

I got this code on here recently <script type=’text/javascript’> $(‘#discountselection’).hide(); $(‘#No’).click(function(){ $(‘#discountselection’).hide(); }); $(‘#Yes’).click(function(){

  • 0

I got this code on here recently

<script type='text/javascript'>
 $('#discountselection').hide();

    $('#No').click(function(){
        $('#discountselection').hide();
    });

    $('#Yes').click(function(){
        $('#discountselection').show();
    });
</script>

The aim being to hide a drop down box depending on whether the radio buttons yes and no were selected. Here is my code:

<td width="338">Would You like to avail of our multiyear discounts?*
  <br />See <a href="Pricing">Pricing</a> for more details
</td>
<td colspan="4">
  <input name="discount" type="radio" id="Yes" value="Yes" />Yes
  <input name="discount" type="radio" id="No" value="No" checked="checked" />No<br />  
     <select class="purple" name="discountselection" id="discountselection">
         <option value="1" selected="selected">1 Year</option>
         <option value="2">2 Years</option>
         <option value="3">3 Years</option> 
      </select>                  
</td>

I have the javascript placed in between the head tags, but for some reason this just isn’t working for me. I’m not familiar with javascript at all. If any one could see where I am going wrong this would be a big help.
Thanks.

  • 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-16T20:24:41+00:00Added an answer on May 16, 2026 at 8:24 pm

    your code is fine, you just need to wrapped it with the ready handler.

    like this,

    $(function() {
        $('#discountselection').hide();
    
        $('#No').click(function() {
            $('#discountselection').hide();
        });
    
        $('#Yes').click(function() {
            $('#discountselection').show();
        });
    });​
    

    you could also shorten your codes like this,

    $(function() {
        $('#discountselection').hide();
        $('#Yes, #No').click(function() {
            $('#discountselection').toggle(this.value==='Yes');
        });
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 535k
  • Answers 535k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer In typical REST API's, example #1 is more correct. Resources… May 17, 2026 at 1:07 am
  • Editorial Team
    Editorial Team added an answer There is a sample called PhotoScroller in Apple's Reference Library.… May 17, 2026 at 1:07 am
  • Editorial Team
    Editorial Team added an answer First for me Page.DataBind() doesn't work for me. I declared… May 17, 2026 at 1:07 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I've got a program that worked until recently. The offending code is shown here:
I have recently downloaded the most recent build of this awesome tool WSDL2OBJC from
Longtime Eclipse user here; I recently discovered the Block Selection Mode (Alt-Shift-A) that was
So something I've been doing recently is adding an additional project to my code
We recently upgraded our PHP and apache versions on our server. Prior to this
I've got this subclass implementing my Interface and there are no errors in terms
I recently upgraded to xampp v1.7.2 which dumped PHP 5.3 on me. Along with
Somewhere on my computer I had a PHP script for displaying an image based
Recently I've come across a problem in my project. I normally compile it in
Recently I have been playing around with the HTTP Proxy in twisted. After much

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.