Page 1 of 1

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

Posted: 06 Apr 2015
by pablodiaz
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

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

Posted: 08 Apr 2015
by Dmitry Kozlov
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;
	}
});