This is a migrated thread and some comments may be shown as answers.
RadInputManager Display Errormessage TextBox control outside
3 Answers 53 Views
This is a migrated thread and some comments may be shown as answers.
shunman
Top achievements
Rank 1
shunman asked on 31 Aug 2011, 07:46 AM
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.

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 31 Aug 2011, 08:35 AM
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.
0
shunman
Top achievements
Rank 1
answered on 31 Aug 2011, 03:50 PM
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>

0
Vasil
Telerik team
answered on 05 Sep 2011, 08:23 AM
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 >>

Tags
Input
Asked by
shunman
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
shunman
Top achievements
Rank 1
Vasil
Telerik team
Share this question
or