In SmallBasic (the tag of these topics) you have to use OR :
If x=7 OR x=9 Then
Jquery if statement only works with one group
Hello,
I have the code below in one of the views on a SharePoint list. The if statement does not work below with the || clause. However, if I only have one group or the other in the if statement. For example if(!IsGroupMember(Admin_Group)) works or if(!IsGroupMember(Directors_Group)) works. However, I need to check both. Can someone tell me what's wrong with the if clause below?
$(document).ready(function() {
Admin_Group = "AP_Admin_Team";
Directors_Group = "Directors - Members";
if(!IsGroupMember(Admin_Group) || !IsGroupMember(Directors_Group))
{
window.location.href = 'http://<site>/depts/AP/Lists/VendorSetupChangeForm/AllItems.aspx';
}
});
thanks,
Developer technologies Small BASIC
4 answers
Sort by: Most helpful
-
WhTurner 1,611 Reputation points
2022-03-08T18:27:07.643+00:00 -
WhTurner 1,611 Reputation points
2022-03-09T10:03:57.537+00:00 You are still using the wrong tag ("small-basic")
The tag "small-basix" is for Technical questions about Microsoft Small Basic, the only text-based language and IDE built for students to learn to code
Please look for a more fittimg tag as your question in not about Small Basic
-
Sherazad Ahmed 411 Reputation points
2022-03-08T18:54:08.657+00:00 Hey sorry, this is query code.
-
Sherazad Ahmed 411 Reputation points
2022-03-08T21:07:01.25+00:00 Actually, found the issue. the if statement should be and not or:
if(!IsGroupMember(Admin_Group) && !IsGroupMember(Directors_Group))