logo

New Response

« Return to the main article

You are replying to:

  1. After reviewing all posts here, I found yet another method which is preferrable for my application. I use category view queries like this... productview.dsp?OpenForm&Products=ABRAS:Con ... that can return "No Documents Found." The view has documents, just not with the category, so I cannot depend on a row count in the view.

    This method effectively does a find and replace on the text "No Documents Found" on the fly.

    Thanks to Fernando Matias Valadao who posted this on http://searchdomino.techtarget.com.

    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 = '<BR><FONT SIZE=2 FACE="Arial" Color =#00673>Nothing found. Please search again.</FONT>'; } tagH2.style.display = "block"; }

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: