This is a migrated thread and some comments may be shown as answers.

RequiredFieldValidator for RadEditor in IE

3 Answers 124 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Pungkas Yoga
Top achievements
Rank 1
Pungkas Yoga asked on 07 Jan 2013, 12:44 AM
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

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 07 Jan 2013, 05:23 AM
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.
0
Pungkas Yoga
Top achievements
Rank 1
answered on 07 Jan 2013, 07:06 AM
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?
0
Princy
Top achievements
Rank 2
answered on 08 Jan 2013, 04:24 AM
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.
Tags
Editor
Asked by
Pungkas Yoga
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Pungkas Yoga
Top achievements
Rank 1
Share this question
or