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 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

Related Questions

I have a login page where user enters Username(textbox), Password(textbox), and location(dropdownlist) then login.
I have a page that contains some dynamically created controls (TextBox and DropDownList). When
I have this code on an aspx page. <asp:DropDownList runat=server ID=ddlSize CssClass=textbox Width=100px> <asp:ListItem
I have a dropdownlist and a textbox with a button on a form. When
I have got a dropdownlist, a submit button and a textbox in my view.
I have update panel that content check box, textbox, 3 DropDownList with CascadingDropDown extender.
I have Dropdownlist on my page and its selectedindexchanged method created in code behind
I have DropDownList with CascadingDropDown extender. If I want to retrieve data from the
I have a Dropdownlist <select name=cate> <option value=h>India</option> <option value=m>USA</option> <option value=c>England</option> </select> <input
Here's the scenario. I have a search page with a TextBox that allows someone

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.