Edit page tabs not hiding by JavaScript

this code that was in Edit Page [Client Script], worked perfectly fine in 2021, now every form shows the tabs that are suppose to be hidden.

<?php if (!$Security->IsSysAdmin()) { ?>
	$("a[href$='tab_tbl_sys_membership3']").hide();
	$("a[href$='tab_tbl_sys_membership4']").hide();
	$("a[href$='tab_tbl_sys_membership5']").hide();
	$("a[href$='tab_tbl_sys_membership8']").hide();
<?php } ?>

the above should hide those tabs, but now they don’t, i;ve removed the condition statement and still doesn’t work, i checked the tab_tbl_sys_membership3 variables and they seem to be valid.

There are a little bit difference between v2021 and v2022 on this.

Let’s take a look from the example demo2021 and demo2022, in cars table.In v2021, the tab link is a part of a href link:
href=“#tab_cars1"In v2022, the tab link is a part of data-bs-target property of the button
data-bs-target=”#tab_cars1"That is why your code used in v2021 will not work in v2022.For v2022, you may simply try the following code in Startup Script under Client Scripts → Table-Specific → Edit Page:

$("li.nav-item > button.nav-link[data-bs-target='#tab_tbl_sys_membership3']").hide();
$("li.nav-item > button.nav-link[data-bs-target='#tab_tbl_sys_membership4']").hide();
$("li.nav-item > button.nav-link[data-bs-target='#tab_tbl_sys_membership5']").hide();
$("li.nav-item > button.nav-link[data-bs-target='#tab_tbl_sys_membership8']").hide();

thanks,that worked ($("li.nav-item > button.nav-link[data-bs-target='#…)do you think there will be any adverse affects if i do a search & replace in the phpmaker project file?, there’s 35 forms x add / edit / view to change…

sticcino wrote:

do you think there will be any adverse affects if i do a search & replace in the phpmaker project file?

Before doing this, always backup your .pmp file first, and then try to search and replace the code by using text editor such as Notepad++. Do not affraid to try, since you have already had the backup .pmp file.

thanks, i did the search and replace, all good with the changes!