user460667 user460667 - 1 year ago 97
HTML Question

HTML Input Checkbox return 'On' instead of 'True' when submitting form

I have a MVC3 app using Project Awesome (, but I am getting a weird behaviour on checkboxes. I have the following simple Html within a Modal popup

<input type="checkbox" class="check-box" name="IsDeleted">

When I submit the form containing this element, its post value is 'on' instead of the expected 'true' (when element is checked).

Does anybody know why this is? I am assuming there may be some javascript somewhere messing with the form data, but wanted to check whether there isn't some HTML I am missing.


Answer Source

Set the checkboxes value attribute to true and you will get true in your post value.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download