Remove 'No documents found' -- W3C standards-compliant

There have been several tips how to remove 'No documents found' messages in Web views. Here is a more W3C standards-compliant version, which should run in all DOM-capable browsers.

There have been several tips how to remove the 'No documents found' messages in Web views.

Some did it by using CSS to hide all H2 tags, others used a "Hide when"-formula and some solutions used JavaScript and the proprietary (=evil) innerHTML JS-property invented by MS.

Here is a more W3C standards-compliant version, which should run in all DOM-capable browsers (Mozilla 1.x, Netscape 6.x and MS IE 5.x/6.x, Opera 7, maybe 6). This utilizes the usual view-serving-form (i.e., "$$ViewTemplateDefault") or page and the $$ViewBody field/embedded view.

Copy and paste the script below your view/view field and mark the entire script as pass-through HTML. I hope this works for all standards-compliant browsers and helps your daily business.

<script type='text/javascript'>
<!-- 
var oH2s = document.
getElementsByTagName('h2');
var oTmp; var oH2;
if(oH2s) {
  for(var i=0;I<oH2s.length;i++) {
    var oTmp = oH2s[i];
    if(oTmp.firstChild.data=='No documents found')
      oH2 = oTmp;
  }
  if(oH2){oH2.firstChild.data='replace this 
text with anything.'};

};
 //-->
</script>

Do you have comments on this tip? Let us know.

This was first published in October 2003

Dig deeper on JavaScript for Lotus Notes Domino

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchDataCenter

SearchExchange

SearchContentManagement

Close