Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

tab change detection

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

tab change detection

Unread post by Timo »

In an edit form, there are some tabs. When the form loads, I run some PHP procedures to dynamically load some content. This loading should only happen, when a certain tab is selected.
To put it differently, I need to detect when another tab in an edit form is selected so that I can then run some JavaScript code. How to detect a tab change, is there an event?
I read similar questions but there has not been an answer.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: tab change detection

Unread post by admin »

Timo,

I hope this helps...

Code: Select all

$('.nuTabSelected')[0].id
tabs.PNG
Steven
You do not have the required permissions to view the files attached to this post.
Timo
Posts: 217
Joined: Thu Mar 15, 2018 9:26 pm
Has thanked: 1 time

Re: tab change detection

Unread post by Timo »

How does this detect when another tab is selected? This retrieves just the id of the selected tab, doesn't it?

Code: Select all

$('.nuTabSelected')[0].id
I'm looking for an event. Thank you.
How to detect a tab change, is there an event?
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: tab change detection

Unread post by admin »

Timo,

There isn't an event for that.

You need to create your own.

Code: Select all

$( ".nuTab" ).click(function() {
  alert( "Handler for .click() called." );
});
Steven
Timo
Posts: 217
Joined: Thu Mar 15, 2018 9:26 pm
Has thanked: 1 time

Re: tab change detection

Unread post by Timo »

Works, thank you :D
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: tab change detection

Unread post by admin »

.
Locked