Loading ...
Sorry, an error occurred while loading the content.

PHP & YUI - navigating to a tab

Expand Messages
  • different2une
    Hello, I want to dynamically navigate to the second tab from the first tab after a certain action is performed. I m using PHP and used the header() function to
    Message 1 of 2 , Apr 27, 2007
    • 0 Attachment
      Hello,

      I want to dynamically navigate to the second tab from the first tab
      after a certain action is performed. I'm using PHP and used the
      header() function to try and navigate to header('Location:
      somelink.php#tab2') but with no effect ... I also tried using
      javascript: document.location.href='somelink.php#tab2' but that didn't
      work either.

      Does anyone know how this is done? The tabs seem to work OK if I just
      click on them individually...

      Thanks.
    • Jon Herron
      You need to set the activeIndex or activeTab properties of the tab view widget. http://developer.yahoo.com/yui/docs/YAHOO.widget.TabView.html#activeIndex
      Message 2 of 2 , Apr 27, 2007
      • 0 Attachment
        You need to set the activeIndex or activeTab properties of the tab view widget.

        http://developer.yahoo.com/yui/docs/YAHOO.widget.TabView.html#activeIndex

        something along the lines of:

        myTabview.set("activeIndex", x) - where "x" is the index of the tab you wish to make active.

        or if you have a reference to the tab you can set the activeTab instead, like

        myTabview.set("activeTab", x) - where "x" is a reference to the tab you wish to make active.
         
        Thanks,

        Jon Herron

        Left Turn Solutions - Home of the Eddy Framework
        http://www.leftturnsolutions.com

        Offical Left Turn Solutions Development Blog
        http://360.yahoo.com/leftturnsolutions


        ----- Original Message ----
        From: different2une <different2une@...>
        To: ydn-javascript@yahoogroups.com
        Sent: Friday, April 27, 2007 2:10:55 PM
        Subject: [ydn-javascript] PHP & YUI - navigating to a tab

        Hello,

        I want to dynamically navigate to the second tab from the first tab
        after a certain action is performed. I'm using PHP and used the
        header() function to try and navigate to header('Location:
        somelink.php# tab2') but with no effect ... I also tried using
        javascript: document.location. href='somelink. php#tab2' but that didn't
        work either.

        Does anyone know how this is done? The tabs seem to work OK if I just
        click on them individually. ..

        Thanks.




        Ahhh...imagining that irresistible "new car" smell?
        Check out new cars at Yahoo! Autos.
      Your message has been successfully submitted and would be delivered to recipients shortly.