Kevin Cho
Kevin Cho

Reputation: 491

How to disable RadNumeric TextBox, but with working spinbuttons?

I have a Telerik RadNumericTextBox that has spinbuttons to increment/decrement the value. I want to prevent the user from entering their own input and to only use the spinbuttons. When I try to disable the textBox or make it readonly, the buttons are disabled as well. Is it possible to keep the buttons functional and make the textBox only for display?

I have certain attributes on this control that I need so continuing to use a Telerk RadNumericTextBox would be more convenient than using other controls.

Upvotes: 1

Views: 1610

Answers (1)

IUnknown
IUnknown

Reputation: 22448

$telerik.$($find("Numeric1").get_element())
.focusin(function(){ this.readOnly = true; })
.focusout(function(){ this.readOnly = false; });

Working on this page http://demos.telerik.com/aspnet-ajax/input/examples/radnumerictextbox/firstlook/defaultcs.aspx

Upvotes: 1

Related Questions