Mapping a checkbox to an action parameter in ASP.NET MVC is not trivial. At least I did not find trivial solution.
To get it working, use the following code:
<input type="checkbox" name="SomeName" id="SomeName"/>
<script type="text/javascript">
$('#SomeName').click(function() {
$(this).attr('value', $(this).attr('checked'));
});
</script>
No comments:
Post a Comment