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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:44:09+00:00 2026-05-10T23:44:09+00:00

I have a DropDownList and a TextBox on a Page. When the user chooses

  • 0

I have a DropDownList and a TextBox on a Page. When the user chooses the ‘other’ option in the DropDownList I want to display a TextBox just to the right of it. I do not want to use the traditional PostBack technique. I want this interaction to be client side.

I am aware that I can get a get a reference to the DOM element and set its style to ‘display:none’ or ‘display:’. What I am looking for is something that is built into the ASP.NET framework for handling something like this. I mean, in jQuery this is as simple as $('controlID').hide. Is there a Control Extender that can do this? Is jQuery part of the ASP.NET framework yet?

  • 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. 2026-05-10T23:44:09+00:00Added an answer on May 10, 2026 at 11:44 pm

    jQuery will be/is distributed with VisualStudio/ASP.NET MVC, though I wouldn’t call it part of the framework. I think that you can feel free to use it and trust that it will be supported.

    Note that Microsoft has said that they will be using the main line of development for jQuery so the code itself won’t be any different than you can download from jQuery.com, except perhaps for built-in Intellisense.

    EDIT: To set up your functionality download the code from jquery.com. Put it in your scripts folder, or wherever you store javascript stuff. Add a script reference for it to your page. Use jquery to add an onchange handler to your dropdown list and when the value of the dropdown list is other show the textbox, otherwise hide it. The example below assumes that other isn’t the default selection. If you are using runat=’server’ controls with MasterPages or inside UserControls, you’ll need to adjust the names in the javascript functions to account for the name mangling that ASP.NET does. Probably simpler to give them unique CSS classes and reference them using the ‘.class’ notation rather than ‘#id’ notation.

    <script type='text/javascript' src='...pathtoscript../jquery.1.2.6.js'></script> <script type='text/javascript'>    $(document).ready( function() {        $('#DropDownListID').bind('change', function() {            if (this.options[this.selectedIndex].value == 'other')            {                $('#TextBoxID').show();            }            else            {                $('#TextBoxID').hide();            }        });    }); </script>    ...   <select id='DropDownList'>      <option value='first'>First</option>       ...      <option value='other'>Other</option>  </select>  <input type='text' id='TextBox' style='display: none;' /> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This is pretty easy, since the Hilbert curve is a… May 13, 2026 at 8:02 am
  • Editorial Team
    Editorial Team added an answer add a return false; inside the form's submit function to… May 13, 2026 at 8:02 am
  • Editorial Team
    Editorial Team added an answer <asp:Panel runat="server" ID="pnlWrapper" DefaultButton="btnHidden"> <asp:LinkButton runat="server" ID="btnVisible" Text="Login" OnClick="btnVisible_Click" />… May 13, 2026 at 8:02 am

Related Questions

I have a DropDownList populated with a SelectList generated from (an anonymous type) that
I have a page which has an Html.DropDownList which takes in a viewdata parameter.
I have a DropDownList as a custom control inserted into a subform which is
I'm new to MVC, but I've been all over this, read all the documentation

Trending Tags

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

Top Members

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.