Tab onclick?

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
holtonba
Posts: 7
Joined: Sun Feb 23, 2014

05 May 2014

Is there a way to run some javascript when a tab is clicked? We have a bunch of tabs and would like to know which tab is clicked so that an HTML element can be set dynamically.

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

06 May 2014

Sure, put the following code into JS-editor of Forms Designer:

Code: Select all

$('#fd_tabcontrol-0').on('tabsactivate', function(event, ui) {
  alert('New tab: ' + ui.newTab.text());
  alert('Previous tab:' + ui.oldTab.text())
});

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 22 guests