Is possible to enable or disable tabs depending on the radio buttons

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
pablodiaz
Posts: 2
Joined: Mon Apr 06, 2015

06 Apr 2015

Hello!


I want to create a form that contains four tabs (let's call them tab 0, tab 1, tab 2 and tab 3). Tab 0 must show a field with three radio buttons. Depending on the button that is chosen, one of the other tabs must be activated. For example, if user selects radio button 1, this activates tab 1, if user selects radio button 2, this activates tab 2 and so on.


Thanks!

Pablo

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

08 Apr 2015

Hi Pablo,

Please, insert the following code into JS-editor of Forms Designer and replace 'Choice' with internal name of your Choice field:

Code: Select all

fd.field('Choice').change(function() {
	switch (fd.field('Choice').value()) {
		case 0:
			$('#fd_tabcontrol-0').tabs('option', 'active', 1);
			break;
		case 1:
			$('#fd_tabcontrol-0').tabs('option', 'active', 2);
			break;
		case 2:
			$('#fd_tabcontrol-0').tabs('option', 'active', 3);
			break;
	}
});

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 14 guests