i have a view where i dynamically add/ delete checkboxes in a table. I´m using the mvc4 razor engine in my view. With the synatx @Html.CheckboxFor(m=>m.xyz) razor creates two input fields. One with the type checkbox and one with type hidden. If i give a class to the checkbox with @Html.CheckboxFor(m=>m.xyz, new {@class= "CheckboxClass}) only the input field with type checkboxget this class. Is there a easy way to give the class to both input fields?
Set class of hidden input created by @html.checkboxfor
1.2k Views Asked by PX Roth At
1
There are 1 best solutions below
Related Questions in ASP.NET-MVC-4
- Jquery: Change contents of <select> tag dynamically
- redirect to actionResult method from an api
- Open another view through controller from jQuery?
- ASP MVC 5 Html.EditorFor not working / Unable to access/use Default Editor Templates
- Having error in updating my record in database my method as follows
- Is it possible to access an additional custom model property from viewdata.modelmetadata.properties?
- Which plugin is used to show the data in front end of socrata
- Set focus on button that triggered page reload
- jQuery: How to traverse / Iterate over a list of object
- Switching CSS Just for that view?
- Protractor, login to asp,net MVC login page, wait for default page then , redirect to angular page and do tests....how?
- Ajax.beginForm() cannot get post value
- Get desired html element's attribute value and set to hidden field before binding in Asp.Net MVC
- Get Value From Dynamically Populated Hidden Field
- Asp.net MVC Routelink null controller parameter
Related Questions in RAZOR
- Getting and passing MVC Model data to AngularJS controller
- Implement Onfailure in webApi controller
- Dynamic roles list in CustomAuthorize ASP MVC
- Jquery: Change contents of <select> tag dynamically
- Submit Button on Razor View doesn't call Action Result - MVC
- ASP MVC 5 Html.EditorFor not working / Unable to access/use Default Editor Templates
- Convert string to date time in a `cshtml` file using razor?
- jQuery: How to traverse / Iterate over a list of object
- Switching CSS Just for that view?
- Hyperlink in table header is not rendering
- why Special characters apostrophe and others shows like this ’, in HTMl file
- Display a tooltip with Html helper
- Cannot access conditional Razor variable as href
- MVC How to bundle html templates of type "text/html"?
- Set a label value for a checkbox helper in asp.net mvc
Related Questions in CHECKBOXFOR
- Prevent a read-only checkbox from calling a event handler?
- Set class of hidden input created by @html.checkboxfor
- Can't get CheckBox to update model in MVC Razor Using Html.CheckBoxFor
- jQuery try to set TextBoxFor values based on unchecking CheckBoxFor in MVC3
- razor editorfor checkbox event binding
- Passing multiple checkbox values & dyamically generating textboxes based on checkboxes checked in MVC 4
- How to have ASP.Net MVC 3.0 Checkboxfor as checked by default?
- MVC3 HTML.CheckBoxFor error
- MVC3 - Viewmodel with list of complex types
- CheckBoxFor not binding to model
- Checkbox to enable or disable a list box
- Adding checkboxes in MVC4
- CheckboxFor is always null
- Binding IList to CheckBoxFor won't return checked values MVC
- Need help for Checkbox as bool? field while rendering from view
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
If you really don't like just leaving things the way they are, then you have a couple options.
$('.chkClass').each(i,e) {$('INPUT[name=' + e.name + ' type=hidden]').remove();}); //untested, and it's very late here.