Hi,
I want to have client side for a checkbox. When the user presses submit button, or checkbox loose focus the validation should be trigged. Basically same behaviour as for textboxes (which are working fine).
I try to make client side validation for a CheckBox
Here is the sample code:
@Html.CheckBoxFor(model => model.RulesAccepted, new { @class = "control-label" })
@Html.ValidationMessageFor(model => model.RulesAccepted)
If I do similar to the example code (http://demos.telerik.com/aspnet-mvc/validator/index) checkbox is validated. If it is not check then I get an error, which is correct.
But there is number of issues preventing me to use that code:
1.Model passed back to the post action does not have boolean value set (RulesAccepted is the property name on the model)
2.I'm not able to plug-in fluent validation messages to display them to the user.
If I try to do any other way no message is appearing when it should.
In the code I have now the TextBoxes validators work fine. I have only problem with CheckBox validator.
I want to have client side for a checkbox. When the user presses submit button, or checkbox loose focus the validation should be trigged. Basically same behaviour as for textboxes (which are working fine).
I try to make client side validation for a CheckBox
Here is the sample code:
@Html.CheckBoxFor(model => model.RulesAccepted, new { @class = "control-label" })
@Html.ValidationMessageFor(model => model.RulesAccepted)
If I do similar to the example code (http://demos.telerik.com/aspnet-mvc/validator/index) checkbox is validated. If it is not check then I get an error, which is correct.
But there is number of issues preventing me to use that code:
1.Model passed back to the post action does not have boolean value set (RulesAccepted is the property name on the model)
2.I'm not able to plug-in fluent validation messages to display them to the user.
If I try to do any other way no message is appearing when it should.
In the code I have now the TextBoxes validators work fine. I have only problem with CheckBox validator.