DOM manipulation alternative for Catalog Client Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2020 06:39 PM
After removing iFrame from catalog items and changing all the UI types to "All" on catalog client scripts, there are a bunch of DOM manipulation that is not supported anymore. Is there a similar method to getElementById of an button and change its style and is there a way to manipulate the innerHTML?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2022 09:54 PM
See if you can do something with a timeout and form controls.
I've used this successfully in the past to alter label styles.
function onLoad(){
setTimeout(function(){
if(window != null){
g_form.getControl('My Label Here').setAttribute('style','display:none');
}else{
var tags = this.document.getElementsByClassName('ng-binding');
var searchText = 'My Label Here';
for(var i=0; i<tags.length; i++){
if(tags[i].textContent.toString() == searchText){
tags[i].style.display = 'none';
}
}
}
},3000);
}
Alternatively try "this" in front of .document
function onLoad(){
this.document.getElementById("IDHere").style.display = none;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2020 11:42 PM
You can try using
var requiredElement = top.document.getElementsByTagName('')
to get the element in the catalog and have your DOM Manipulation.