Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I thought they could be, but as I'm not putting my money where my mouth was (so to speak) setting the readonly attribute doesn't actually seem to do anything.

(我以为他们可以,但是因为我不把钱放在我的嘴里(可以这么说)设置readonly属性实际上似乎没有做任何事情。)

I'd rather not use Disabled, since I want the checked check boxes to be submitted with the rest of the form, I just don't want the client to be able to change them under certain circumstances.

(我宁愿不使用Disabled,因为我希望检查复选框与表单的其余部分一起提交,我只是不希望客户端在某些情况下能够更改它们。)

  ask by community wiki translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
325 views
Welcome To Ask or Share your Answers For Others

1 Answer

you can use this:

(你可以用这个:)

<input type="checkbox" onclick="return false;"/>

This works because returning false from the click event stops the chain of execution continuing.

(这是有效的,因为从click事件返回false会停止执行链继续。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...