RatTooltip Validation issue

4 posts, 0 answers
  1. Bill
    Bill avatar
    42 posts
    Member since:
    Feb 2011

    Posted 12 Aug 2012 Link to this post

    Referring to the attached code for my usercontrol, the comments dialog (tooltip) pops up fine and saves fine if I do not use any validators or set the save button to causesValidation="false"
    If I add one or more validators (all but 1 commented out), the validation fires if I leave the field blank but if I enter text, I dont get any validation errors but the onclick doesnt fire.

    Any ideas?

    <%@ Control Language="vb" AutoEventWireup="false" CodeBehind="ctrlDealRatings.ascx.vb" Inherits="DealNutWebsite.ctrlDealRatings" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript" id="telerikClientEvents1">
            function OnClientRated(controlRating, args) {
                var tooltip = $find("<%=RadToolTip1.ClientID %>");
            function HideTooltip(controlRating, args) {
                var tooltip = $find("<%=RadToolTip1.ClientID %>");
                return (false);
    <div id="DealRatingDiv" runat="server" visible="true" style="position:relative;top:0px;width:200px;border:0px solid red">
        <asp:Label class="CaptionSm" ID="lblCaption" runat="server" Text="Click a Nut to Rate:" style="float:left; margin-top: 6px"></asp:Label>
        <div style="float:left; margin-top: 0px">
            <telerik:RadRating ID="RadDealRating" runat="server" Skin="MyCustomSkin" AutoPostBack="false"
                               readonly="true"  EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false" OnClientRated="OnClientRated"
                               Precision="half" />
    <telerik:RadToolTip ID="RadToolTip1" runat="server"
                        ShowEvent="FromCode" HideEvent="FromCode"
                        AutoCloseDelay="1000" ShowCallout="true"
                        Position="MiddleLeft" Width="275px"
                        Animation="Resize" ManualClose="True"
                        Height="300px" >
        <div class="AddDealRatingbox">
            <asp:Image ID="Image1" runat="server" ImageUrl="/Images/RateThisDeal.png" />
            <br />
            <asp:Label ID="lblName" runat="server" Text="Name:"></asp:Label>
            <br />
            <asp:TextBox ID="txtName" runat="server" style="width:260px" />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
            ErrorMessage="Your name is required"
            SetFocusOnError="True" >Your name is required</asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
            ErrorMessage="Please use plain text only"
            Text="Please use plain text only"
            SetFocusOnError="True" />
             <br />
            <br />
            <asp:Label ID="lblInstructions" runat="server" Text="Your feedback:"></asp:Label>
            <br />
            <asp:TextBox ID="txtComments" runat="server" TextMode="MultiLine"  Rows="5" Columns="30" style="width:260px" />
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                                        ValidationGroup="save"    CssClass="Errors" ControlToValidate="txtComments"
                                        ErrorMessage="Your comment is required"
                                        EnableViewState="False" ViewStateMode="Disabled" >Your comment is required</asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
            ErrorMessage="Please use plain text only"
            text="Please use plain text only"
            CssClass="Errors" ValidationExpression="[^<]+"
            SetFocusOnError="True" />
            <br /><br />
            <asp:ImageButton ID="btnPostComment" runat="server"
                             Style="outline:0; cursor:pointer" ValidationGroup="save"
                             ImageUrl="~/Images/btnPostComment.png" OnClick="btnPostComment_Click" CausesValidation="True" />
            <asp:ImageButton ID="btnCancel" UseSubmitBehavior="false" runat="server"
                             Style="margin-left:12px; outline:0; cursor:pointer"
                             OnClientClick="HideTooltip()" ImageUrl="~/Images/btnCancel.png" />
  2. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 14 Aug 2012 Link to this post

    Hello Bill,

    I noticed that the validator controls you have commented out don't have their ValidationGroup property set. That would the reason your validators aren't firing.

    I hope that helps.
  3. Bill
    Bill avatar
    42 posts
    Member since:
    Feb 2011

    Posted 14 Aug 2012 Link to this post

    I tried it with and without the group properties. No difference.
  4. Marin Bratanov
    Marin Bratanov avatar
    3908 posts

    Posted 16 Aug 2012 Link to this post

    Hi Bill,

    You would need to set ValidationGroup for all controls that take part in the logic. I tried this scenario and it works fine on my end. I also suggest you make sure you have added the event handler properly for VB - you have AutoEventWireup=false in the control directive. I am attaching here my sample page along with a video from my test as a reference.

    Marin Bratanov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top