Page 1 of 1

Enable / Disable Tab for a group

Posted: 09 Nov 2016
by wdeffner
Hi,

Disabling and enabling a tab based on the content of a field works fine like this:

---

// Disable enable Tab
function setAdminTab() {
var status = fd.field('Anrede').control().value();
if (status == 'Frau') {
$('#fd_tabcontrol-0').tabs('option', 'disabled', null);
} else {
$('#fd_tabcontrol-0').tabs('option', 'disabled', [3]);
}
}

setAdminTab();

---

Now I would like to use the function IsCurrentUserMemberOfGroup in the if-statement but haven't been successful so far (Sharepoint 2013). I'm not familiar with Java-Script.

Thank you

Wolfgang

Re: Enable / Disable Tab for a group

Posted: 10 Nov 2016
by Dmitry Kozlov
Hi Wolfgang,

It's not a JS-function. You can use this method to create completely different forms for a certain SharePoint group. Please, watch the video:

https://www.youtube.com/watch?v=SBLD9hXr19o

https://www.youtube.com/watch?v=bI7TFO_bN6c

Re: Enable / Disable Tab for a group

Posted: 11 Nov 2016
by wdeffner
Hi,

we have tried creating different forms based on group-membership or user-defined rules. This works very good and was one of the main reasons for purchasing SPForms.

However, this leads to a larger set of forms that have to be maintained in parallel. For this reason we were looking for a way to enable/disable single elements based on group-membership and/or user-defines rules.

If I understand you correctly, this is not possible.

Thank you

Wolfgang

Re: Enable / Disable Tab for a group

Posted: 11 Nov 2016
by Dmitry Kozlov
I see your concern. You can hide or disable fields or tabs conditionally via JavaScript but if the condition is based on user's membership, you should use groups. Please, read the post demonstrating our JS-framework:
http://spform.com/office-365/cond ... ynamically