更改复选框的值而不会导致“点击”在上面 [英] changing the value of a checkbox without resulting with a "click" on it

查看:86
本文介绍了更改复选框的值而不会导致“点击”在上面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



所以我有一个用户表单,如果满足某些条件,我想取消选中某些复选框等等。问题是,我还有一些指令应该发生时单击该框,但这些操作在实际值更改时完成,即使没有发生单击也是如此。我怎么能绕过这个?我试图有一些布尔障碍,但由于我的代码的复杂性,没有合理的做法。是否有一些属性我可以用来改变价值而不记录点击?

感谢

丹尼尔

解决方案

丹尼尔,

我不确定我是否完全关注你,但你可以将复选框的值设置为0(未选中)或1(选中)。

你也可以使用点击事件(而不是更改事件)来检查和设置值并运行您的代码。 这可以将其从更改事件中解放出来,您可以决定其他代码的运行时间。

第二个选项是给它静音处理,直到它完成它所说的为止。  : - )

Hi,

so i have a user form, and i want to uncheck certain checkboxes if some conditions are met, etc. the problem is, i also have instructions that are supposed to take place when the box is clicked, BUT these are done when the actual value is changed, even if no click takes place. how can i get around this? i tried to have some boolean barriers but because of the complexity of my code, theres no logical way of doing it. is there some property i can use to just change the value and not register a click?

thanks

Daniel

解决方案

Daniel,

i am not sure i follow you completely but you can set the value of the checkbox to 0 (unchecked) or 1 (checked).

you can also use the click event (instead of the change event) to check and set the value and run your code.  this would free it up from the change event and you can decide when the additional code runs.

Second option would be to give it the silent treatment until it does what it's told.  :-)


这篇关于更改复选框的值而不会导致“点击”在上面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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