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

Update FontInfo in client

1 Answer 26 Views
Input
This is a migrated thread and some comments may be shown as answers.
Peichung
Top achievements
Rank 1
Peichung asked on 02 Mar 2009, 06:47 PM
Hi,

I added underline FontInfo on the server side by doing:

radTextBox.Font.Underline =

true;

I then would like to remove the underline text decoration in the client-side OnValueChanging handler:

 

 
 
function(sender, eventArgs)  
 
{  
 
if (eventArgs.get_newValue() == "")  
 
eventArgs.set_cancel(true);  
 
sender.get_styles().EnabledStyle[0] += "text-decoration: none;";  
 
sender.updateCssClass();  
 
}  
 
 
 

The above codes didn't remove the text decoration.  Please advise.  Thanks,

Peichung

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 04 Mar 2009, 09:24 AM
Hi Peichung,

You should remove the text-decoration from the hovered and focused states as well:

function ValueChanging(sender, args)
{
    if (args.get_newValue() == "")
    {
        args.set_cancel(true);
        sender.get_styles().EnabledStyle[0] += "text-decoration:none;";
        sender.get_styles().HoveredStyle[0] += "text-decoration:none;";
        sender.get_styles().FocusedStyle[0] += "text-decoration:none;";

        sender.updateCssClass();
    }
}

All the best,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Input
Asked by
Peichung
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or