Topic: Checkbox is AWOL in ASP.NET MVC when using CheckBoxFor due to hidden input.
Ryan Ternier
free
asked 10 years ago
rhubka
free
answered 8 years ago
using System; using System.Web.Mvc; using System.Linq.Expressions; using System.Web.Mvc.Html;
Multinerd
free
answered 8 years ago
It appears this has not been fixed yet. in MDB 4.5.0 and the js provided above does not work.
Heres a 'MvcHtmlString ' extension im using the works
https://gist.github.com/multinerd/21debdc7a9278049c82ae8078e1b148b
just replace
@Html.CheckBoxFor(m => m.RememberMe, new { @class = "form-control validate", id = "loginform-rememberme" })
with
@Html.BasicCheckBoxFor(m => m.RememberMe, new { @class = "form-control validate", id = "loginform-rememberme" })
Bartłomiej Malanowski
staff
answered 9 years ago
howie418
pro
answered 9 years ago
howie418
pro
answered 9 years ago
brijesh@njit.edu free commented 7 years ago
this solution worked for me, thanks.
I wish MDB should have fixed it by now.
TyronSmith priority commented 7 years ago
Thank you, this works great!
Bartłomiej Malanowski
staff
answered 10 years ago
Ryan Ternier
free
answered 10 years ago
Ryan Ternier
free
answered 10 years ago
Bartłomiej Malanowski
staff
answered 10 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- ForumUser: Free
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No