开发者

MVC Checkbox 'disable' true issue

I have two controls ControlEdit and ControlView with some inputs and checkbox and two views ReadOnly and Edit, I was using Mv开发者_StackOverflow中文版cContribn checkbox helper to make checkbox disable I did set attribute disable to true on defaultView(here I am loading ControlView) by default user chant make any changes on that view, then if user click change button he comes to edit view (ControlEdit) and here everything enabled.

For some reason every time on EditView check box became unchecked. I was trying to use default check box html helper - the same story.

On edit view it is always becoming unchecked. When I remove disable true attribute on ViewControl then it is became working and in that case check box does not loosing his state on EdivVew.

Then I was using jQuery to set checkbox disable, didn't help. I did look different browsers the same story everywhere. I am getting correct behavior only when i does not setting disable to true on ReadOnly view. May be somebody come across that. Need help.


-FIXED-

Finally I fixed that, I wrapped checkbox in to div and make checkbox disable inside div like this

$('#DivWrapper :input').attr("disabled", true)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜