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

[Solved] Set Font of input controls in Rad Editor

5 Answers 166 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Artur Gabdrakhmanov
Top achievements
Rank 1
Artur Gabdrakhmanov asked on 16 Nov 2009, 11:23 AM
Hello,
I want to change font of input control (textbox or button) in RadEditor in Design mode. But when I select it the font names combobox and font size combobox becomes disabled. When I set the font in HTML mode (style="font-family: comic sans ms; font-size: 50px;") the input font changes.
Is it possible to change the font of input controls using Rad Editor standard tools?
Thanks.

5 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 19 Nov 2009, 08:28 AM
Hi Artur,

You can easily apply the desired font for the input and textarea elements by setting the CssFiles property to point to your own css file in the web application and putting the following class in the css file:

input, textarea
{
 font-family: comic sans ms;
 font-size: 50px;
}

You can find more information in this help article: Setting Content Area Defaults.

All the best,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Artur Gabdrakhmanov
Top achievements
Rank 1
answered on 19 Nov 2009, 08:36 AM
Thank you, I know this way of changing font:) But I'd like to change font by Editor tools, because end-user should be allowed to change font of input and he doesn't know html to set font in html mode or write own css file.
0
Rumen
Telerik team
answered on 24 Nov 2009, 12:40 PM
Hi Artur,

These elements are hasLayout elements in Internet Explorer and you should double click on them to enable them for typing and editing. This is the only way to enable the FontName and FontSize dropdowns of RadEditor.

Greetings,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Artur Gabdrakhmanov
Top achievements
Rank 1
answered on 24 Nov 2009, 01:08 PM
When I double click on them and select text and then try to change font it is not changed!
0
Rumen
Telerik team
answered on 26 Nov 2009, 03:41 PM
Hi Artur,

Actually, I realized that the requested feature could not be achieved. The form element store their text in its value attribute. This value attribute could contain however only plain text content.

I can tell you how to enable the FontName dropdown which is disabled when editing input form elements, but it cannot insert HTML markup with the selected font in the value attribute of the input button or textarea elements.

What you can do is to create your own custom classes for input elements, populate them in the ApplyClass dropdown and instruct your end-users how to apply the classes via the dropdown to the selected input elements, e.g.

<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
    .inputLargeText, .textareaLargeText
    {
      font-family: comic sans ms;
      font-size: 20px;
    }
    .inputMediumText, .textareaMediumText
    {
      font-family: Arial;
      font-size: 12px;
    }
    .inputSmallText, .textareaSmallText
    {
      font-family: Tahoma;
      font-size: 6px;
    }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="sc1" runat="server">
        </asp:ScriptManager>
<telerik:radeditor runat="server" ID="RadEditor1">
    <Content>
         <strong>Sample Content</strong>
    </Content>
</telerik:radeditor>



Best wishes,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Editor
Asked by
Artur Gabdrakhmanov
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Artur Gabdrakhmanov
Top achievements
Rank 1
Share this question
or