Rounded corner and EmpryMessage in the textbox and textarea

5 posts, 1 answers
  1. pei yin
    pei yin avatar
    3 posts
    Member since:
    Jan 2010

    Posted 31 Jan 2010 Link to this post

    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.


  2. Answer
    Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 04 Feb 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. pei yin
    pei yin avatar
    3 posts
    Member since:
    Jan 2010

    Posted 09 Feb 2010 Link to this post

    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.
  5. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 10 Feb 2010 Link to this post

    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.
  6. pei yin
    pei yin avatar
    3 posts
    Member since:
    Jan 2010

    Posted 10 Feb 2010 Link to this post

    Thanks for the reply. It's help me a lot.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017