Is possible to enable or disable tabs depending on the radio buttons
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
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
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi Pablo,
Please, insert the following code into JS-editor of Forms Designer and replace 'Choice' with internal name of your Choice field:
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;
}
});
-
- Information
-
Who is online
Users browsing this forum: No registered users and 13 guests