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

Alter Textbox Appearance When Value Changed

3 Answers 78 Views
Input
This is a migrated thread and some comments may be shown as answers.
kencox
Top achievements
Rank 1
kencox asked on 25 Mar 2010, 01:49 AM
I need a visual indicator on the input controls to show unsaved changes.

Does anyone have an example of altering the background colour, border, or some other part of a control's UI to indicate the user has changed the value since saving?

Thanks,

Ken

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Mar 2010, 07:38 AM
Hello Ken,

Try the following approach in order to change the backcolor  after changing the value.

JavaScript:
 
<script type="text/javascript"
    var textBox; 
    function OnValueChanged(sender, args) { 
        textBox = sender; 
        setTimeout("textBox._textBoxElement.style.backgroundColor = 'yellow';", 10); 
    } 
</script> 
[Attach OnValueChanged event to RadTextBox]

-Shinu.
0
kencox
Top achievements
Rank 1
answered on 26 Mar 2010, 11:05 PM
This is close, but the background colour doesn't stay.

I need to keep the "changed" appearance until the next save (postback)

Ken
0
Accepted
Dimo
Telerik team
answered on 29 Mar 2010, 08:46 AM
Hi Ken,

In order to change the appearance of a RadInput textbox, so that it is preserved, you should modify the control's styles collection:

http://www.telerik.com/help/aspnet-ajax/input_clientsidebasics.html

Apart from EnabledStyle, you can also modify HoveredStyle and FocusedStyle.

SomeStyle[0] is for inline styles, while SomeStyle[1] is for CSS classes.

Kind regards,
Dimo
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
Tags
Input
Asked by
kencox
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
kencox
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or