Valiodator Callout Extender SetFocus to Tab

5 posts, 0 answers
  1. sircutbreaker
    sircutbreaker avatar
    111 posts
    Member since:
    Oct 2007

    Posted 15 Aug 2009 Link to this post

    if I have several textboxes in a radmultipage controlled by a radtabstrip...
    and there are required fields... and I have the validators set to setfocusonerr...

    how can I make the tabstrip go to the tab that contains the textbox with the current validator that is firing off when i press the update/insert button in the user control?

    Any help would be appreciated.

    Jeff
  2. sircutbreaker
    sircutbreaker avatar
    111 posts
    Member since:
    Oct 2007

    Posted 15 Aug 2009 Link to this post

    even if i can just have a client side routine that places the selected tab back to the first one.. that would suffice..

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 20 Aug 2009 Link to this post

    Hello sircutbreaker,

    You can select particular tab by using one of the following RadTab client-side methods - set_selected(), select() or click(). For details on the matter please refer to this help article.

    Regards,
    Paul
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. sircutbreaker
    sircutbreaker avatar
    111 posts
    Member since:
    Oct 2007

    Posted 25 Aug 2009 Link to this post

    Yes, but how would I have the required field validator fire off the javascript ?

    I am using standard asp.net validation controls.
  6. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 26 Aug 2009 Link to this post

    Hi sircutbreaker,

    You can use the click() method, i.e.

    <form id="form1" runat="server"
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
        </telerik:RadScriptManager> 
     
        <script type="text/javascript"
            function test() { 
                var tabstrip = $find('<%= RadTabStrip1.ClientID %>') 
                tabstrip.get_tabs().getTab(1).click(); 
            }     
        </script> 
     
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" 
            SelectedIndex="0"
            <Tabs> 
                <telerik:RadTab runat="server" Text="Root RadTab1"
                </telerik:RadTab> 
                <telerik:RadTab runat="server" Text="Root RadTab2"
                </telerik:RadTab> 
            </Tabs> 
        </telerik:RadTabStrip> 
        <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0"
            <telerik:RadPageView ID="RadPageView1" runat="server"
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="RequiredFieldValidator" 
                    ControlToValidate="TextBox1"></asp:RequiredFieldValidator></telerik:RadPageView> 
            <telerik:RadPageView ID="RadPageView2" runat="server"
                page2 
            </telerik:RadPageView> 
        </telerik:RadMultiPage> 
        <input id="Button1" type="button" value="button" onclick="test()" /> 
        </form> 


    All the best,
    Paul
    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017