使用JavaScript禁用SpinButton
我得到了一个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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过执行
radnumerictextbox1.disable();
来解决它。I solved it by doing
RadNumericTextBox1.disable();