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

Issue with updating background color of a RadTextBox via JavaScript

1 Answer 277 Views
Input
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 09 Sep 2008, 10:44 AM
Hi,

I need to implement a password strength indicator. To indicate the password's quality I want the password input text box to change it's background color from red to green when the user enters a character.
Since the RadTextBox's client-event "OnKeyPress" is not thrown on delete keys, I use
"onKeyUp" here is my JavaScript function which shall set the background color to red
(just for debugging purposes):
 function checkPassword() { 
            var passwdBox = $find("<%= PasswordBox.ClientID %>"); 
             
            passwdBox.get_styles().EnabledStyle[0] += "background-color: Red;"
            passwdBox.updateCssClass(); 
        } 

The problem is, that the color simply does not change. What's wrong with my code?
Best regards,
Robert

1 Answer, 1 is accepted

Sort by
0
Missing User
answered on 09 Sep 2008, 11:52 AM
Hi Robert,

Please find attached a sample web application that demonstrates the needed approach.

Regards,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Input
Asked by
Robert
Top achievements
Rank 1
Answers by
Missing User
Share this question
or