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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:17:30+00:00 2026-06-10T03:17:30+00:00

When a certain value from a drop-down box is selected, I want another section

  • 0

When a certain value from a drop-down box is selected, I want another section of the form to be shown using jQuery’s show() function. Currently, my code above the header looks like this:

<script>   
    $(":input#location").change(function(){
      if($(this).val() === 'On Rental'){
        $('div#dpo').show("slow");
      }
    }
</script>

And, the form is coded like this:

<p>
    <strong><label for="location">Location</label></strong>
</p>
<select name="location" id="location">
    <option value="Clarksville">Clarksville</option>
    <!--etc.-->
</select>

<div id="dpo" style="display:none">
  <!--Stuff I want to show here.-->
</div>

For some reason, nothing happens when I select “On Rental” from the drop-down field, and I can’t for the life of me figure out what I’m doing wrong. Can anyone see 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-06-10T03:17:32+00:00Added an answer on June 10, 2026 at 3:17 am

    I tried all of the suggestions above (including wrapping it in the document.ready function), but I couldn’t get it to work . I eventually got the code to work (as I originally had it) when I placed at the bottom of the document, rather than in the header. I don’t know enough about JavaScript and jQuery to know why that would be…?

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

Sidebar

Related Questions

I want to remove every occurance of a certain value from a list. I
I want to get values from a row with the largest certain value (in
The below code removes certain values from a drop down menu. It works fine
I need to hide certain options from Multiple selection box using Javascript. I can't
I have a question about grabbing a certain value from the html response data
How to select elements with certain value from STL container and move them at
I am trying to delete certain key/value pairs from a hash, but I get
How to read a double value from a String with a certain precision (say
Here is my run-of-the-mill drop down: <select name=> <option value=>--Select One--</option> <option value=textarea>Text Area</option>
i'm looking to place a value from a text box lets say 12 to

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.