Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

set focus after validation

$
0
0
Hi,

If you want to focus RadRating when you use it in combination with a CustomValidator, for example if the validation fails, you can try the following approach:
  1. Set the TabIndex property of the rating control so that it can be focused:
    <telerik:RadRating ID="RadRating1" runat="server" TabIndex="1">
    </telerik:RadRating>
  2. Modify the body of the ValidateRating handler in order to include retrieving of the HTML element of the rating and focusing it. The following example shows how to do so when the validation fails:
    function ValidateRating(source, args) {
        args.IsValid = (args.Value > 0);
        if (!args.IsValid) {
            $find("<%=RadRating1.ClientID %>").get_element().focus();
        }
    }


Regards,
Slav
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

Viewing all articles
Browse latest Browse all 94857

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>