Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have come across an issue that I have having trouble getting past. I have a view that is using the the following checkbox in a preview popup window:
HTML
@Html.CheckBoxFor(x => x.Payee)


In IE 10, this checkbox passes the value back to the model and works correctly. However, in IE 11 and Chrome this value is not being passed back. Has anyone encountered this before or have suggestions of an approach to resolve this issue?

Update:
In looking a little more I did notice the query strings between IE 10 (works) and Chrome(does not work) are different.

In IE 10 query string has:
HTML
Payee=true&Payee=false


In Chrome the query string has:
HTML
Payee%5b%5d=true&Payee%5b%5d=false


Is there a way to get it to pass the above query string? Or am I going in the wrong direction?

Thanks!
Posted
Updated 15-May-14 8:16am
v2
Comments
Kornfeld Eliyahu Peter 15-May-14 11:43am    
Read these posts:
http://www.mindstick.com/Articles/2ee905ba-aea1-4d83-a49d-d8d8fb10c747/?Checkbox%20control%20in%20MVC
http://stackoverflow.com/questions/658458/mvc-html-checkbox-and-form-submit-issue

1 solution

Found the solution to the issue. Needed to add the following code to the view and it runs great now!

HTML
<script type="text/javascript">
    $(document).ready(function () {
        $.ajaxSettings.traditional = true;
    })
</script>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900