使用JavaScript禁用SpinButton

发布于 2025-02-13 18:47:39 字数 879 浏览 0 评论 0原文

我得到了一个radnumerictextbox,带有属性showspinbuttons设置为true,TextField本身已阅读,并且使用SpinButtons进行了更新。

但是,我希望每当检查/未选中复选框时,这些旋转式武器都会被禁用和启用。

通过设置set_showspinbuttons属性为false用JS来掩盖SpinButtons。

但是我似乎无法管理两者,我不明白我在做错了

<telerik:RadNumericTextBox ID="RadNumericTextBox2" runat="server" MinValue="1" MaxValue="100" MaxLength="3" 
 ShowSpinButtons="True">
   <NumberFormat DecimalDigits="0" ZeroPattern="n" />
</telerik:RadNumericTextBox>

我的javascript:

RadNumericTextBox1.set_showSpinButtons(false); //trying everything at this point
RadNumericTextBox2.SpinUpButton.disabled = true;
RadNumericTextBox2.SpinDownButton.disabled = true;
RadNumericTextBox2.SpinUpButton.enabled = false;
RadNumericTextBox2.SpinDownButton.enabled = false;

I got a RadNumericTextBox with the attribute showSpinButtons set to true, the textfield itself is readonly and it's updated by using the spinbuttons.

but I want those spinbuttons to be disabled and enabled whenever a checkbox is checked/unchecked.

OR

hiding the spinbuttons by setting the set_showSpinButtons attribute to false with JS is also fine.

but I can't seem to manage both, I don't understand what I'm doing wrong

<telerik:RadNumericTextBox ID="RadNumericTextBox2" runat="server" MinValue="1" MaxValue="100" MaxLength="3" 
 ShowSpinButtons="True">
   <NumberFormat DecimalDigits="0" ZeroPattern="n" />
</telerik:RadNumericTextBox>

my javascript:

RadNumericTextBox1.set_showSpinButtons(false); //trying everything at this point
RadNumericTextBox2.SpinUpButton.disabled = true;
RadNumericTextBox2.SpinDownButton.disabled = true;
RadNumericTextBox2.SpinUpButton.enabled = false;
RadNumericTextBox2.SpinDownButton.enabled = false;

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

将军与妓 2025-02-20 18:47:39

我通过执行radnumerictextbox1.disable();来解决它。

I solved it by doing RadNumericTextBox1.disable();

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文