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

[Solved] Rad Editor Validation Focus

1 Answer 149 Views
Editor
This is a migrated thread and some comments may be shown as answers.
simhadri raju saripalli
Top achievements
Rank 1
simhadri raju saripalli asked on 14 Dec 2009, 08:00 AM
When i use the Ajax Validator callout Extender for the Rad Editor Control after setting the property of setfocusonerror for the Validator call out extender for required field the fous is not getting in the Radeditor

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 15 Dec 2009, 01:13 PM
Hi simhadri,

Currently ValidatorCalloutExtender is not compatible with the RadEditor control. We will try to provide support for it in one of the upcoming versions of RadEditor for ASP.NET AJAX.

As a workaround, you can use CustomValidator to simulate RequiredFieldValidator and set focus on the editor in the ClientValidationFunction.

e.g.:

<script type="text/javascript">
    function ClientValidationFunction(sender, args) {
          
        //Note that sender is NOT the RadEditor but the span of the validator.
        //The content is contained in the args.Value variable
          
        //some validation code goes here
          
        var editor = $find("<%=RadEditor1.ClientID %>");//get reference of the RadEditor control
        editor.setFocus();//set focus to the RadEditor control
    }
</script>
<telerik:RadEditor ID="RadEditor1" runat="server">
</telerik:RadEditor>
  
<asp:CustomValidator 
    ID="CustomValidator1" 
    Runat="server" 
    ControlToValidate="RadEditor1"
    ClientValidationFunction="ClientValidationFunction" 
    Display="static">Some Error Message!</asp:CustomValidator><br />
<AjaxToolkit:ValidatorCalloutExtender ID="ValidatorExtender1" TargetControlID="CustomValidator1" >
</AjaxToolkit:ValidatorCalloutExtender>
  
<asp:button Runat="server" ID="Submit" Text="Submit" Width="80px"></asp:button>

 

Kind regards,
Dobromir
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Editor
Asked by
simhadri raju saripalli
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or