Ankur Bawiskar
Tera Patron
Options
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 12-30-2024 02:35 AM
Many a times there is a requirement to hide the label of MRVS in native and portal.
OOB there is no method to achieve this requirement.
Below script will help us achieve the same using DOM manipulation.
Ensure isolate script field is False so that DOM manipulation works. This field may not be on form but you can make it false from list.
function onLoad() {
//Type appropriate comment here, and begin script below
setTimeout(function() {
var searchTitle = "Servers"; // give the MRVS Title here
if (window != null) {
// native
$j(document).ready(function() {
$j('span').each(function() {
if ($j(this).text() === searchTitle) {
$j(this).hide();
}
});
});
} else {
var aTags = this.document.getElementsByClassName("sp-field-label-padding ng-binding");
for (var i = 0; i < aTags.length; i++) {
if (aTags[i].textContent.toString() == searchTitle) {
aTags[i].style.display = 'none';
break;
}
}
}
}, 3000);
}
Output: Working fine in both native + portal
Note: DOM Manipulation is not recommended practice