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

Rounded corner and EmpryMessage in the textbox and textarea

4 Answers 253 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
pei yin
Top achievements
Rank 1
pei yin asked on 01 Feb 2010, 03:53 AM
hi,

Actually, i want two kinds of textbox. One have rounded corners and emptyMessage, another one have rounded corners and error massage.  The error massage is like  to warning people that they must input something before they save the information.

at the first time, i have use <telerik> to create a textarea with the emptyMessage, but the corner is not curved.

in the second time, i have use FormDecorator & <asp.textbox> to create a textarea with the rounded corners, but there cannot set empyMessage use asp.

then i try to add <cc1:TextBoxWatermarkExtender> to make a emptyMassage. Although it have a emptyMessage, it not beautiful like the telerik's emptymassage.

finally, i try to use <asp.testbox> & <telerik:RegExpTextBoxSetting> to create a rounded textbox with the error massage. But it cannot work. 

I am a beginner of telerik. So please explain it in details. Thank u so much.


4 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Tunev
Telerik team
answered on 04 Feb 2010, 09:48 AM
Hello pei yin,

You could try with the following setup:
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" EnableRoundedCorners="true"
    DecoratedControls="Textbox" />
<telerik:RadTextBox EmptyMessage="Empty message" runat="server" Skin="">
    <ClientEvents OnFocus="applyEMStyle" OnBlur="applyEMStyle" OnMouseOver="applyEMStyle"
        OnMouseOut="applyEMStyle" OnValueChanged="applyEMStyle" OnLoad="myLoad" />
</telerik:RadTextBox>
 
<script type="text/javascript">
 
    function myLoad(sender, args)
    {
        sender.updateCssClass = function() { };
        applyEMStyle(sender, null);
    }
 
    function applyEMStyle(sender, args)
    {
        var c = "";
        if (sender.get_value() == "" && !sender._focused)
        {
            c = "#ccc";
        }
        if (sender._textBoxElement.style.color != c)
            setTimeout(function() { sender._textBoxElement.style.color = c; }, 1);
    }
 
</script>
 
</form>


Kind regards,
Georgi Tunev
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
pei yin
Top achievements
Rank 1
answered on 10 Feb 2010, 04:30 AM
hi,
I appreciate your reply. 
It is work. But i still got some problems. 

How can i set the textbox to be the multi-line textbox? If i set the TextMode="MultiLine", the corner is not curved. 

And how can i put the error message into the textbox? i have use:
<telerik:RadInputManager ID="RadInputManager1" runat="server">
            <telerik:RegExpTextBoxSetting BehaviorID="RagExpBehavior1" Validation-IsRequired="true"
                ValidationExpression="^[a-zA-Z0-9,\s,\@]*$" ErrorMessage="Your Name Is Required" >
                <TargetControls>
                    <telerik:TargetInput ControlID="txtName" />
                </TargetControls>
            </telerik:RegExpTextBoxSetting>
        </telerik:RadInputManager>
But cannot get the error message. Can u teach me how to put an error message into the textbox with rounded corners?

Thanks.
0
Dimo
Telerik team
answered on 10 Feb 2010, 11:08 AM
Hello pei yin,

Please do the following:

<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" EnableRoundedCorners="true"
    DecoratedControls="Textbox,Textarea" />

<telerik:RadInputManager ID="RadInputManager1" runat="server" Skin="">


Note that:

1. Rounded corners for RadInputManager are not supported in the current official version. You can try using the latest internal build.
2. The error message will not have a red color. A textbox cannot be styled by both RadInputManager and RadFormDecorator at the same time.


Regards,
Dimo
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
pei yin
Top achievements
Rank 1
answered on 11 Feb 2010, 02:27 AM
Thanks for the reply. It's help me a lot.
Tags
General Discussions
Asked by
pei yin
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
pei yin
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or