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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:28:29+00:00 2026-05-28T01:28:29+00:00

I have read existing questions however they do not seem to resolve my problem.

  • 0

I have read existing questions however they do not seem to resolve my problem.
I would like to be able to hide the div “answer_wrapper” when the option “Open Ended” is selected for the drop down list.

I have written some code, however when I run the solution nothing appears to happen when selecting the “Open Ended” option in the drop down list.

Any help would be much appreciated.

$(function () 
{
    $("#QuestnType").change(function () 
    {
        ToggleDropdown();
    });
    ToggleDropdown(); 
});
function ToggleDropdown() 
{
    if ($("#QuestnType").val() == "Open Ended") 
    {
        $("#answer_wrapper").hide();
    }
    else 
    {
        $("#answer_wrapper").show();
    }
 };

The drop down list

<asp:DropDownList runat="server" ID="QuestnType" CssClass="form">
    <asp:ListItem Value="1">Check Boxes</asp:ListItem>
    <asp:ListItem Value="2">Drop Down</asp:ListItem>
    <asp:ListItem Value="3">Open Ended</asp:ListItem>
    <asp:ListItem Value="4">Radio Buttons</asp:ListItem>
</asp:DropDownList>
<div id="answer_wrapper">
    some code here
</div>

Where am I going 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-28T01:28:29+00:00Added an answer on May 28, 2026 at 1:28 am

    “Open Ended” is the text, the value value is 3

    if ($("#QuestnType").val() == 3) ...
    

    or

    if ($("#QuestnType").text() == "Open Ended") ...
    

    one other thing to note is that Server Ids != client Ids. if the drop down exists within another server control the client id becomes an ugly auto-generated webforms client id. either inject the client id into the jquery selector or use a unique class name to select the control.

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

Sidebar

Related Questions

I have read the other questions and they mostly talk about the security of
I have read the existing questions on external/internal linkage over here on SO. My
I have read through the solutions to similar problems, but they all seem to
I have read through several reviews on Amazon and some books seem outdated. I
I have read in some of the ClickOnce posts that ClickOnce does not allow
I feel like I'm so close to working this out and have read dozens
I've read many of the existing questions/threads on this subject, but keep in mind
I'm implementing a REST-style interface and would like to be able to create (via
I have read a lot of these but I have a few questions that
I have read lots of questions and answers about this issue on StackOverflow, but

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.