You need to sign in to do that
Don't have an account?
arabisays
Hide Sidebar Search Options Using JavaScript(JQuery)
Hi,
I am trying to hide some of the Side Bar Search options(Usually it has all the Objects) using JavaScript.
I have created a custome home page component and pasted the below code by clicking Edit HTML.
$("#sen option[value='087']").remove();
$("#sen option[value='a04']").remove();
$("#sen option[value='a07']").remove();
$("#sen option[value='a0B']").remove();
$("#sen option[value='a0H']").remove();
$("#sen option[value='a0I']").remove();
$("#sen option[value='a0K']").remove();
$("#sen option[value='a0L']").remove();
But I am not able to hide the components.
PS: I have pasted the HTML of the side bar search to JSFiddle and used the same script. It is working fine in JSFiddle.
I am trying to hide some of the Side Bar Search options(Usually it has all the Objects) using JavaScript.
I have created a custome home page component and pasted the below code by clicking Edit HTML.
$("#sen option[value='087']").remove();
$("#sen option[value='a04']").remove();
$("#sen option[value='a07']").remove();
$("#sen option[value='a0B']").remove();
$("#sen option[value='a0H']").remove();
$("#sen option[value='a0I']").remove();
$("#sen option[value='a0K']").remove();
$("#sen option[value='a0L']").remove();
But I am not able to hide the components.
PS: I have pasted the HTML of the side bar search to JSFiddle and used the same script. It is working fine in JSFiddle.
function hideLinks() {
$("#sen option[value='087']").remove();
$("#sen option[value='a04']").remove();
$("#sen option[value='a07']").remove();
$("#sen option[value='a0B']").remove();
$("#sen option[value='a0H']").remove();
$("#sen option[value='a0I']").remove();
$("#sen option[value='a0K']").remove();
$("#sen option[value='a0L']").remove();
$("#sen option[value='0Q0']").remove();
}
if (window.addEventListener) {
window.addEventListener("load", hideLinks, false);
} else if (window.attachEvent) {
window.attachEvent("onload", hideLinks);
}