gpt4 book ai didi

c# - 从cs页面禁用输入类型单选按钮单击并使用js向用户发送警报?

转载 作者:行者123 更新时间:2023-11-30 18:05:18 24 4
gpt4 key购买 nike

我有一个单选按钮,它对经理禁用,但对其他人启用它需要从 cs 页面单选按钮 onclick 处理。从 aspx 禁用 radio 的代码是

<INPUT type="radio" name="myButton" value="theValue"
onclick="this.checked=false;
alert('Sorry, this option is not for manager!')">

如何在我正在做的cs页面中做

rbtnOpen.Attributes.Add("OnClick", "this.checked=false; alert('Sorry, this option is not available!')");

它工作正常并且还显示警报但是当页面刷新时。假设我有 3 个统计数据 A、B、C....对于一个 iten B,如果他单击 A 或 C,则为经理选择 radio 应该在关闭警报后提示警报,它应该再次显示 B ..在我的情况下,它提示警报,但所有单选按钮都未选中

最佳答案

试试这个

            <!DOCTYPE html>
<html>
<head>
<script>
function check()
{

alert('Sorry, this option is not available!');
document.getElementById("b").checked=true;
}
</script>
</head>
<body>

A<input type="radio" name="gender" id="a" value="a" onclick="check()"/>
B<input type="radio" name="gender" id="b" value="b" />
C<input type="radio" name="gender" id="c" value="c" onclick="check()"/>

</body>
</html>

关于c# - 从cs页面禁用输入类型单选按钮单击并使用js向用户发送警报?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15963472/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com