Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

open form, go to tab

Questions related to using nuBuilder Forte.
Locked
Timo
Posts: 221
Joined: Thu Mar 15, 2018 9:26 pm
Has thanked: 1 time

open form, go to tab

Unread post by Timo »

I got some buttons on a home page. Each of them opens the same edit form. How can I make each button open a different tab of the form?

E.g. the button "Open Tab 1" runs/opens the customers form and switches diretly to the Tab 1
E.g. the button "Open Tab 2" runs/opens the customers form and switches diretly to the Tab 2
etc..
opentabs.PNG
editform.PNG
You do not have the required permissions to view the files attached to this post.
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: open form, go to tab

Unread post by toms »

Hi,

Add an onclick handler in the button's custom code:
custcode.png
In your form:

Code: Select all

function nuSelectTabByTitle(tab) {
    $('[id^=nuTab]').each(function (index) {
        if ($(this).html() == tab) {
            var tabNumber = +index -1;
            var e = document.getElementById('nuTab' + tabNumber);
            nuSelectTab(e);
            return true;
        }
    });
}

if (nuFormType() == 'edit') {
   var tab =  sessionStorage.getItem("selectTab");
   nuSelectTabByTitle(tab);
}
You do not have the required permissions to view the files attached to this post.
admin
Site Admin
Posts: 2829
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 30 times

Re: open form, go to tab

Unread post by admin »

Timo,

toms has the right idea - set a variable on onclick.
tab1.PNG

Code: Select all

window.formTabNo=2;
tab2.PNG

Code: Select all

nuOpenTab(window.formTabNo);
https://wiki.nubuilder.cloud/ ... #nuOpenTab

Steven
You do not have the required permissions to view the files attached to this post.
Timo
Posts: 221
Joined: Thu Mar 15, 2018 9:26 pm
Has thanked: 1 time

Re: open form, go to tab

Unread post by Timo »

Thank you guys :D
admin
Site Admin
Posts: 2829
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 30 times

Re: open form, go to tab

Unread post by admin »

.
Locked