RadInputManager Display Errormessage TextBox control outside

4 posts, 0 answers
  1. shunman
    shunman avatar
    77 posts
    Member since:
    Jul 2011

    Posted 31 Aug 2011 Link to this post

    I'm using RadInputManager with RegExpTextBoxSetting.
    default displaying position is inside control.
    Is there way to display Validation ErrorMessage to outside?
    How can i make that? let me know good idea.

    thanks.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 31 Aug 2011 Link to this post

    Hello Shunman,

    Take a look at the following forum thread which discusses similar scenario.
    How to display "Required" in password textbox with RadInputManager?.

    Thanks,
    Princy.
  3. shunman
    shunman avatar
    77 posts
    Member since:
    Jul 2011

    Posted 31 Aug 2011 Link to this post

    thank you for answering. 
    well, i have a new question.

    how can i cancel the client-side  validating event  when control lost focus?
    here is my code.

    i added ASP.NET validator controls, and it works good.   but when i click the textbox and lost focus, raise OnBlur event and Validating event.  i'm looking for blocking validating event when the control lose the focus.
    <%@ Page Language="VB" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="RadControlsWebApp1._Default" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head runat="server">
        <title></title>
        <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
    </head>
    <body>
        <telerik:RadCodeBlock runat="server">
            <script type="text/javascript">
                function OnValidating(sedner, args) {
                    //here do how?
                }
                function OnBlur(sender, args) {
                    //do how?
                }
            </script>
         
        </telerik:RadCodeBlock>
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
            //Put your JavaScript code here.
        </script>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
        <div>
            <telerik:RadInputManager runat="server">
                 <telerik:RegExpTextBoxSetting BehaviorID="RagExpBehavior1" Validation-IsRequired="true"
                ClientEvents-OnValidating="OnValidating" ClientEvents-OnBlur="OnBlur"
                ValidationExpression="^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$"
                Validation-ValidationGroup="EmailCheck">
                <TargetControls>
                    <telerik:TargetInput ControlID="TextBox1" />
                </TargetControls>
            </telerik:RegExpTextBoxSetting>
            </telerik:RadInputManager>
        </div>
        <div>
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><asp:Button ID="Button1" runat="server" Text="Check" ValidationGroup="EmailCheck"/>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1"
                    ValidationGroup="EmailCheck" ErrorMessage="Email is Required"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator  ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBox1"
                    ErrorMessage="Invalid Email" ValidationGroup="EmailCheck"></asp:RegularExpressionValidator>
        </div>
        </form>
    </body>
    </html>

  4. Vasil
    Admin
    Vasil avatar
    1638 posts

    Posted 05 Sep 2011 Link to this post

    Hi Shunman,

    This resources may help you to Enable/Disable an asp Validator client side:
    http://msdn.microsoft.com/en-us/library/aa479045.aspx
    http://aspnet-tips-tricks.blogspot.com/2008/02/enabledisable-requiredfieldvalidator.html

    Regards,
    Vasil
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top