No Documents Found

| | Comments (0) |

After reviewing all posts here, I found this method preferrable for my application, because I needed to provide a different message other than No Documents Found. Thanks to Fernando Matias Valadao who posted this on http://searchdomino.techtarget.com.

I've made one technical correction. Step 2 needs to be in the On Load and not the JS Header.

1) In the "HTML Head Content" of your form or page, add this code: "< style> H2 {display:none;} </style>"

This momentarily hides any H2 text, including the No Documents Found message.

2) Add this code to the "On Load" event of your form or page. It searches all H2 text and replaces the No Document Found text. It then displays all H2 text.

var noDocumentsFound = document.body.all.tags("H2");
var tagH2, textH2;

for (var i = 0; i < noDocumentsFound.length; i++){
tagH2 = noDocumentsFound[i];
textH2 = tagH2.innerText;
if (textH2.toLowerCase() == "no documents found"){
tagH2.innerHTML = '
Nothing found. Please search again.';
}
tagH2.style.display = "block";
}


Categories

Leave a comment

About this Entry

This page contains a single entry by Jeb published on October 10, 2003 8:20 PM.

Randy on NPR was the previous entry in this blog.

MT Plugins is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.31-en

Good Reads

Flickr Badge

www.flickr.com
This is a Flickr badge showing items in a set called Wallet. Make your own badge here.