选中尚未选中的表单中的复选框 [英] Check the checkbox in a form that has not been checked

查看:85
本文介绍了选中尚未选中的表单中的复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目中只有一个复选框,如果我检查了那么它应该闲置然后它没有任何意义



我是什么尝试过:



i尝试多个复选框,但我只需要复选一次复选框只有一个复选框

I have only one checkbox in my project and if i checked that then it shoud be idle then it doesn't have any sense

What I have tried:

i tried for multiple checkboxs but i need to check the checkbox only one time am having only one check box

推荐答案

我假设你指的是一个ASP.net复选框,给出你对网页的评论和问题上的C#标签......



如果你准备忍受一个灰色的复选框,只需在复选框的点击事件中将Enabled属性设置为False。



或者在CheckChanged事件中将值设置回post post的原始值。



本文还有其他使用JavaScript / jQuery的方法如何在ASP.NET中创建只读复选框 [ ^ ]但请注意警告
I am assuming that you are referring to an ASP.net checkbox given your comment about a web page and the C# tag on the question...

If you are prepared to put up with a greyed out checkbox simply set the Enabled property to False in the click event for the checkbox.

Alternatively set the value back to the original value on post back in the CheckChanged event.

There are other methods using JavaScript / jQuery on this article How To Create Read Only CheckBox In ASP.NET[^] but do heed the warnings


这篇关于选中尚未选中的表单中的复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆