Can someone please help me with creating a text link to a jstools tab. I would like a text link on my first tab linking to my second tab. I can't find an answer to this, but see it asked often without answer.

This is the method I am using to create my tabs.

    $form = array();

  $form['mytab'] = array(
    '#type' => 'tabset',
  );
  $form['mytab']['tab1'] = array(
    '#type' => 'tabpage',
    '#title' => t('Details'),
    '#content' => include ('test.php'),
  );
  $form['mytab']['tab2'] = array(
    '#type' => 'tabpage',
    '#title' => t('tab 2'),
    '#content' => t('contents of tab 2'),
  );
  $form['mytab']['tab3'] = array(
    '#type' => 'tabpage',
    '#title' => t('tab 3'),
    '#content' => t('contents of tab 3'),
  );

  return tabs_render($form);
?>

Comments

pwieck’s picture

Bump
----------------------------------------------------------------------------------------------
Drupaling on 18 wheels

pwieck’s picture

Still looking for help
-----------------------------------------------------------------------------------------------------
Drupaling on 18 wheels

pwieck’s picture

Bump again
-----------------------------------------------------------------------------------------------------
Drupaling on 18 wheels

nathan573’s picture

Ever figure this out? Here is some code that I have used to do this. This actually demonstrates linking to embedded tabs (embedded in tab 3 in this case), hence the first call to "triggerTab(3)" in the parent tabset, and then the next call to the desired tab.

			<script>
			function triggerTab1() {
				$('#tabs-product_page_tabs1').triggerTab(3);
				$('#tabs-product_page_tabs').triggerTab(1);
			}
			function triggerTab2() {
				$('#tabs-product_page_tabs1').triggerTab(3);
				$('#tabs-product_page_tabs').triggerTab(2);
			}
			function triggerTab3() {
				$('#tabs-product_page_tabs1').triggerTab(3);
				$('#tabs-product_page_tabs').triggerTab(3);
			}
			function triggerTab4() {
				$('#tabs-product_page_tabs1').triggerTab(3);
				$('#tabs-product_page_tabs').triggerTab(4);
			}
			</script>
		
			<a href="javascript:triggerTab1();">Open sub tab 1</a>
			
			<a href="javascript:triggerTab2();">Open sub tab 2</a>
			
			<a href="javascript:triggerTab3();">Open sub tab 3</a>
			
			<a href="javascript:triggerTab4();">Open sub tab 4</a>