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

"Required" message exists even after the value is entered in the Email body.

4 Answers 118 Views
Getting started with ASP.NET
This is a migrated thread and some comments may be shown as answers.
Kannan
Top achievements
Rank 1
Kannan asked on 13 Aug 2013, 11:06 AM
Hi ,

I'm using telerik rad editor with required field Validator ..

When click submit button it shows Required that is right after entering value in emailbody after i click button only the required is invisible but normal textbox i click outside of the textbox it self required is invisible . 


While click button event only the Required message will visible and invisible  this is happened only Rad editor but other controls while click outside also the required is visible and invisible

Refer your link

http://demos.telerik.com/aspnet-ajax/editor/examples/validators/defaultcs.aspx#qsf-demo-source


     <telerik:RadEditor ID="CorrespondenceAlertEditor" runat="server" OnClientLoad="OnClientLoad"
                        ContentFilters="None" EnableResize="false" Skin="Gray" ToolsFile="~/Contracting/ToolsFile.xml"
                        Width="99%">
                        <CssFiles>
                            <telerik:EditorCssFile Value="~/EditorContent.css" />
                        </CssFiles>
                        <Content>                  
            
                        </Content>
                    </telerik:RadEditor>

    <asp:CustomValidator ID="ctmValrfvEmailBody" runat="server" Text="◄ Required" ValidationGroup="ClientValidation"
                        Display="Dynamic" ClientValidationFunction="ValidateEditText"></asp:CustomValidator>    


Thanks,
Kannan.


4 Answers, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 15 Aug 2013, 03:28 PM
Hi Kannan,

The custom validator control is designed for validating with a custom client-side logic. For example, in the mentioned demo the function checkLength() performs the check whether the length of the content is less than 50 characters. You can examine this MSDN article about the CustomValidator control for more information.

If the case is that you need the editor to be only a required field you could use the RequiredFieldValidator control instead of the above mentioned control. The following code sample shows this approach:
<telerik:RadEditor ID="CorrespondenceAlertEditor" runat="server" _OnClientLoad="OnClientLoad"
    ContentFilters="None" EnableResize="false"
    Width="99%">
</telerik:RadEditor>
 
<asp:RequiredFieldValidator ID="CorrespondenceValidator" runat="server" Text="◄ Required"
    ControlToValidate="CorrespondenceAlertEditor" Display="Dynamic"></asp:RequiredFieldValidator>

Which is the version of RadControls for ASP.NET AJAX that you are currently using?

If you are still having difficulties, please send step by step instructions for reproducing the problem in the linked demo so that I can inspect it locally. You can use a video for this purpose.

Regards,
Ianko
Telerik
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 the blog feed now.
0
Kannan
Top achievements
Rank 1
answered on 16 Aug 2013, 06:22 AM
Hi Ianko ,

Thanks for your reply. I knew that we have to use Required field validator My problem is


After clicking submit button only it shows Required .
but other controls when click any of page it self it showing required . hope you clear about my problem .

I'm using Telerik.Web.UI namespace hope it is 2008 version .


Check your example in Telerik website
http://demos.telerik.com/aspnet-ajax/editor/examples/validators/defaultcs.aspx#qsf-demo-source

there we click any where its Required  after typing data it gone thats good but Rad editor not behave like that ( I think on change event )

Thanks,
Kannan.
0
Ianko
Telerik team
answered on 20 Aug 2013, 03:28 PM
Hi Kannan,

The described functionality is not a part of the RadEditor control's implementation, because the editor is a textbox in an iframe and could not modify the show/hide functionality of the validator control. The RadTextBox control exists in the same document where the validator is, this is why the event handler responsible for listening the content can modify the validator's visibility.

Nevertheless, you could implement a custom Client-side functionality attached to the OnClientSelectionChange event of the editor, in which the logic will check if it is typed in the content and show or hide the validator's message. 

Regards,
Ianko
Telerik
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 the blog feed now.
0
Tony
Top achievements
Rank 1
answered on 31 Jul 2014, 05:22 AM
I was having the same problem. Thanks for the solution.   



-------------------------------------------
http://jelqingresults.net
Tags
Getting started with ASP.NET
Asked by
Kannan
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Kannan
Top achievements
Rank 1
Tony
Top achievements
Rank 1
Share this question
or