Causing Validation on the click of a TabPanel

Last post 04-22-2008 8:18 PM by pardo. 2 replies.

Sort Posts:

  • Causing Validation on the click of a TabPanel

    03-31-2008, 10:35 PM
    • Member
      287 point Member
    • pardo
    • Member since 11-11-2004, 6:54 AM
    • Posts 92

    I'd like to cause validation to fire my control validators when the tab header of another tab is clicked. My questions are:

     

    1. How do I accomplish this?

    2. All content from all tabs is present in the clients memory. So how do I supress the validators on other tabs from being fired?

     

    Thanks,


    pardo

  • Re: Causing Validation on the click of a TabPanel

    04-04-2008, 5:52 AM
    Answer

    Hi Pardo,

    Firstly, you'd attach a javascript to TabContainer's OnClientActiveTabChanged event.

    <ajaxToolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="1" OnClientActiveTabChanged="onTabChanged">

    Secondly, you shall validate on onTabChanged function.

                function onTabChanged(sender, args){
                    Page_ClientValidate();
                }

    http://forums.asp.net/p/1239218/2271427.aspx#2271427

    Best regards,

    Jonathan

    Jonathan Shen
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: Causing Validation on the click of a TabPanel

    04-22-2008, 8:18 PM
    • Member
      287 point Member
    • pardo
    • Member since 11-11-2004, 6:54 AM
    • Posts 92

    Jonathan, just got around to trying this now and it works good! Thanks!

     

    pardo

Page 1 of 1 (3 items)