RequiredFieldValidator for RadEditor in IE

4 posts, 0 answers
  1. Pungkas Yoga
    Pungkas Yoga avatar
    8 posts
    Member since:
    Nov 2012

    Posted 06 Jan 2013 Link to this post

    Hi,

    I got problem with asp:RequiredFieldValidator for RadEditor, but this only happen in IE (I'm using IE 9).
    This is my code :

    <telerik:RadEditor EditModes="Design" Height="250" Width="700" ID="txtBody" runat="server"
              ToolsFile="~/RadEditorTool.xml" Content='<%# Bind("Body") %>'>
              <CssFiles>
              <telerik:EditorCssFile Value="~/Styles/EditorContentArea.css" />
              </CssFiles>
    </telerik:RadEditor>
    <asp:RequiredFieldValidator ID="reqtxtBody" runat="server" ControlToValidate="txtBody"
               CssClass="FieldValidator" ErrorMessage="Body has to be set" ValidationGroup="save">
               <asp:Image ID="Image3" runat="server" AlternateText="error" ImageUrl="~/Images/exclamation12x12.gif"
               Width="12" Height="12" />
    </asp:RequiredFieldValidator>

    The validator doesn't work.
    It seems like the ID "txtBody" is not attributed to the RadEditor. But I'm not sure.
    Can you help me?

    Regards,
    Pungkas
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 06 Jan 2013 Link to this post

    Hi,

    I tried to replicate the issue that you are facing at my end and it worked ad expected under the telerik version 2012, 3, 1016, 35.

    ASPX:
    <telerik:RadEditor EditModes="Design" Height="250" Width="700" ID="txtBody" runat="server" ToolsFile="~/RadEditorTool.xml" Content='<%# Bind("Body") %>'>
          <CssFiles>
            <telerik:EditorCssFile Value="~/Styles/EditorContentArea.css" />
          </CssFiles>
    </telerik:RadEditor>
    <asp:RequiredFieldValidator ID="reqtxtBody" runat="server" ControlToValidate="txtBody" CssClass="FieldValidator" ErrorMessage="Body has to be set" ValidationGroup="save">
          <asp:Image ID="Image3" runat="server" AlternateText="error" ImageUrl="~/Images/exclamation12x12.gif" Width="12" Height="12" />
    </asp:RequiredFieldValidator>
    <asp:Button ID="Button" runat="server" ValidationGroup="save" />

    Please take a look into this demo for more information.

    Hope this helps.

    Regards,
    Princy.
  3. Pungkas Yoga
    Pungkas Yoga avatar
    8 posts
    Member since:
    Nov 2012

    Posted 07 Jan 2013 Link to this post

    Hi Princy,

    Yes you right, the error is caused by the validationGroup. But I need the validationGroup.
    Is there any other solution rather than removing the validationGroup?
  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 07 Jan 2013 Link to this post

    Hi,

    I tried to replicate the issue that you are facing after adding the ValidationGroup property under the telerik version 2012, 3, 1205, 35  and it worked as expected at my end. Please make sure that you are using the latest version of telerik controls. Following is the sample code.

    ASPX:
    <telerik:RadEditor EditModes="Design" Height="250" Width="700" ID="txtBody" runat="server" Content='<%# Bind("Body") %>'>
        <CssFiles>
            <telerik:EditorCssFile Value="~/Styles/EditorContentArea.css" />
        </CssFiles>
    </telerik:RadEditor>
    <asp:RequiredFieldValidator ID="reqtxtBody" runat="server" ControlToValidate="txtBody" CssClass="FieldValidator" ErrorMessage="Body has to be set" ValidationGroup="save">
        <asp:Image ID="Image3" runat="server" AlternateText="error" ImageUrl="~/Images/exclamation12x12.gif" Width="12" Height="12" />
    </asp:RequiredFieldValidator>
    <asp:Button ID="Button1" runat="server" ValidationGroup="save" />

    Hope this helps.

    Regards,
    Princy.
Back to Top