This is a migrated thread and some comments may be shown as answers.

RadNumericTextBox

2 Answers 74 Views
Input
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 17 Nov 2015, 11:08 PM

I need to change the background color of the text box based on the value the user enters.  For instance if the value is less than 10 then I want the background to be blue, if it greater than 20 I want it to be red.  Between 10 and 20 the background should remain white.  I have tried changing the style.background property in the onBlur client event, but have not had any success.  Any help would be appriciated.

 

2 Answers, 1 is accepted

Sort by
0
Andy
Top achievements
Rank 1
answered on 18 Nov 2015, 03:49 PM
0
Eyup
Telerik team
answered on 20 Nov 2015, 08:43 AM
Hello Andy,

If you want to achieve this requirement dynamically using script, you can make avail of the updateCssClass
method as demonstrated in this section:
http://docs.telerik.com/devtools/aspnet-ajax/controls/numerictextbox/client-side-programming/overview#changing-the-appearance-style-of-radinput-controls-on-the-client

You can also check the following article:
http://docs.telerik.com/devtools/aspnet-ajax/controls/numerictextbox/appearance-and-styling/styles

Hope this helps.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Input
Asked by
Andy
Top achievements
Rank 1
Answers by
Andy
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or