I have quicktab structure:

[tab_1 - find node]
views for finding nodes

[tab_2 - add node]
block with form to add node

at bottom of tab_1 content I have message: don't find what you want? please add!

and "please add" would link, that open tab_2
may be something like this:

<a href="#" onclick="some_function_to_change_active_tab(2)">please add</a>

please, help to find this some_function... !

thanks!

Comments

aprium’s picture

try something like

var tabnum = 2;
$('ul.quicktabs_tabs li.tab' + tabnum + ' a').trigger('click');

brooho’s picture

Status: Active » Closed (fixed)

Great! It works!
Thank you very much!

One small addition to those who would use this:

<a href="/mypage?quicktabs_1=1#quicktabs-1" onclick="$('ul.quicktabs_tabs li.qtab-1 a').trigger('click');return false;">Please add!</a>

And it will works even without javascript!

doublejosh’s picture

More generic solutions here: http://drupal.org/node/421226#comment-6064832

Allows the above to become...
<a href="/mypage?quicktabs_1=1#quicktabs-1" class"tablink">Please add!</a>