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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:28:33+00:00 2026-05-26T17:28:33+00:00

CheckBoxFor renders a hidden field with the same name ( and for good reason

  • 0

CheckBoxFor renders a hidden field with the same name (and for good reason)

I need to enable/disable some other INPUT fields based on the value of the CheckBox when the page loads. However, I can’t get the JQuery selector right. My function ends up firing twice because the selector is getting both the CheckBox and the Hidden input fields.

This is what I have tried and neither work:

$('input[name$="Selected",type=checkbox]').each(function (){
   alert('here ' + this.name);
   EnableOrderItemDropDowns(this);
});

$('input[name$="Selected"],:checkbox').each(function (){
   alert('here ' + this.name);
   EnableOrderItemDropDowns(this);
});

Neither of these approaches work. The latter approach still doesn’t filter to just the CheckBox inputs, so the call to EnableOrderItemDropDowns still fires twice.

  • 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-26T17:28:34+00:00Added an answer on May 26, 2026 at 5:28 pm
    $('input[name$="Selected"][type="checkbox"]')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got an editor template which renders out a checkbox: @Html.CheckBoxFor(model => model.Follow) Which
I have a model which has a boolean property and some other properties that
@Html.CheckboxFor(m -> m.List[0].Value) // Value is bool property generates something like this: <input id=List_0__Value
MVC3 and using the Telerik Grid. I'm using Phil Haacks Hidden Indexer Input For
It doesn't seem that the Html.CheckBoxFor helper adds the correct checked attribute when rendering
I'm working on a page where the user needs to fill in some information
I have a C# MVC3 project and am having trouble implementing the HTML.CheckBoxFor. I
I have Html helper method, creating a check box along with some text, I
I need a checkbox but the underlying data is of type smallint in the
I have my checkbox for a bool field like so in my view: =Html.CheckBox(Active,

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.