This technique can be used to hide or update HTML content. With most fields being identified with a <DIV ID=....> tag, you can use the innerHTML method in Javascript. However, let's say you want to change a particular Error message. The error message tag is not idented. The source code looks like this:
<TABLE WIDTH=100% CLASS=ErrorContent><TR><TD>Error Mesage</TD></TR></TABLE>
In order to hide or change it, you will have to use its class instead. The following script can be placed under "Custom Content".
<script for=window event=onload>
function LoadMe(){
document.getElementsByClassName = function(cl) {
var retnode = [];
var myclass = new RegExp('\\b'+cl+'\\b');
var elem = this.getElementsByTagName('*');
for (var i = 0; i < elem.length; i++) {
var classes = elem[i].className;
if (myclass.test(classes)) retnode.push(elem[i]);
}
return retnode;
};
var myElement = document.getElementsByClassName('ErrorContent')[0];
if (myElement.innerText=='ImpersonateLoggedOnUser2 failed 5'){
myElement.innerText="Please check your domain security settings.";
}
}
LoadMe();
</script>
In the script above, it will change the message if the error is "ImpersonateLoggedOnUser2 failed 5" to something else.