Page 1 of 1

Set URL on a tab

Posted: 21 Jun 2018
by Oz.Ab
Hi guys.

I have an edit form with tabs.

I want the last tab (tab number 5) to have the title "...see more" and when the user clicks that tab another edit form will open in a dialog.

Can I do this?

Regards :)

Re: Set URL on a tab

Posted: 21 Jun 2018
by Nikita Kurguzov
Dear Oz,
Not sure what form you want to open, so I can't help with the actual URL, but you can use JavaScript to modify a tab that way. Just add an extra tab and use it for these purposes:

Code: Select all

//url to open
var url = 'https://google.com';

//keep the current tab checked:
var currenttab = $('#fd_tabcontrol-0 li[aria-selected="true"] a');
//keep track of the current tab:
$('#fd_tabcontrol-0 li:not([aria-controls="fd_tabcontrol-0-tab-4"])').click(function(){
    currenttab = $('#fd_tabcontrol-0 li[aria-selected="true"] a');
});

//fd_tabcontrol-0 - number of the tab control on the form and tab-4 - number of the tab to click
$('li[aria-controls="fd_tabcontrol-0-tab-4"]').click(function(e){ 
    //click on the current tab to prevent the redirect one from opening
    currenttab.click();
    window.open(url, '_blank', "height=400,width=600");
});

Re: Set URL on a tab

Posted: 22 Jun 2018
by Oz.Ab
Thank you Nikita you're a wizard ;)