0

So I included this jquery form plugin called multiswitch (credits to the source) in my MVC web project and integrated it using Html.Checkboxfor() in my Create.cshtml and in my model 'IsReserved' bool property. However, it doesn't bind well in my model when I click the submit button and call the Http post of my controller. Refer to screenshots and public repo link below:

https://github.com/ricsierics/Multiswitch-Demo

View codeUser InterfaceModelController

1
  • Using that plugin with CheckBoxFor() does not make sense since the CheckBoxFor() method generates 2 inputs - <input type="checkbox" .... value="true" /> and <input type="hidden" .... value="false" /> Commented Jun 9, 2017 at 6:57

1 Answer 1

0

Surprisingly, I can now bind the multiswitch to my model well by adding or removing the 'checked' attribute. See screenshots below. Done also committing changes on the said repo link.

jquery function

debugging

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.