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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:00:27+00:00 2026-06-05T17:00:27+00:00

I am working show the drop down values on selection of a check box.

  • 0

I am working show the drop down values on selection of a check box. But with the below code, all different items that are present in the drop down coming directly.

Somehow the @Html.DropDownListFor is not working inside select tag, can anyone please help me to fix it?

Note: Checkbox toggle working perfectly.

Thank you,

.cshtml

<input type="checkbox" /> 
<p>check this box to escalate</p>          
<select disabled="disabled">    
@Html.DropDownListFor(
    model => model.EscalationQueue,
        new SelectList(Extensions.EscalationQueue, Model.EscalationQueue),
          new { @class = "escalation-queue", name = Model.EscalationQueue }
)  
</select>

.js file

var dropdownToggle = function () {
    $("input:checkbox").change(function () {
        if ($("input:checkbox").is(":checked")) {
            $("select").removeAttr("disabled");
        }
        else {
            $("select").attr("disabled", "disabled");
        }
    });
}

$(document).ready(function () {
    dropdownToggle();
});

Output:

CurrentOutput1

CurrentOutput2

  • 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-05T17:00:28+00:00Added an answer on June 5, 2026 at 5:00 pm

    You dont need the <select> tag, the HtmlHelper DropDownListFor will render that for you.
    If you want to initialize the dropdown as disabled set the html attribute as you did for declaring a cssclass…

    <input type="checkbox" /> 
    <p>check this box to escalate</p>  
    @Html.DropDownListFor(
            model => model.EscalationQueue,
            new SelectList(Extensions.EscalationQueue, Model.EscalationQueue),
            new { @class = "escalation-queue", 
                    name = Model.EscalationQueue, 
                    disabled= "disabled" 
             }
    )  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I create a new usermeta field with a drop down selection values?
i want to control the drop down box to control show or hide statement.
I'm working on adapting a chained drop-down feature that I found online to my
I'm currently working on a web site that will show kind a image gallery
I have a dropdown box that I construct with PHP. Here is the code:
So, basically I have this select / drop down menu that I use AJAX
I'm trying to show a dropdown box using the jquery. It's working well. I
This code is working but there must be a better way to do this
I am trying to load a drop down option values based on database information.
I am working with KendoUI, I created drop down list with Json data by

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.