How to hide "Indicates required" ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 12:28 AM
Hey all,
I need to hide the indicator that says "Indicates required", I know its not the best practice but this is what I was been asked for. Tried onload script that catches the class if the indicator but for some reason its returning null.
this is the script that I wrote
also this is the div details
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2024 12:31 AM
use CSS in Instance Option:
.sc-cat-item-legend {
display: none;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2024 01:24 AM
Hi @eyal abu hamadoccasionally the DOM elements may not load immediately. You can use a timer to allow the page additional time to load.
Also, ensure that the "Isolated Script" checkbox is unchecked in the client script record.
function onLoad() {
setTimeout(function(){
var mandatoryLegend = this.document.querySelector('.sc-cat-item-legend');
mandatoryLegend.style.display = 'none';
}, 100);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2024 01:58 AM
I'd use this in case there is a need for single catalog item to be modified.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2024 03:02 AM
I agree with this comment.