Manage Learn to apply best practices and optimize your operations.

Validate Search Criteria Before Submitting Your Search

By default, there is no validation on the search form Domino provides. If you submit the search without entering criteria, the "Page cannot be displayed error" will pop-up. Here's a code snippet to show you what to add to fix that.
In this example, the user must select from at least one of the fields (SRegion, SLocation, or SDocType) which are all dialog lists. Place the following code in the click event of the search button:

//Declare a variable for the form;
Sfrm = parent.main.document.forms[0];

//Verify all the fields are not null, so the query is not null.
if( SRegion.options[SRegion.selectedIndex].text=="" 
	&& SLocation.options[SLocation.selectedIndex].text==""
	&& SDocType.options[SDocType.selectedIndex].text=="")	{
		alert("Please select criteria to search on.");
                           //You must return false so the browser knows not to execute the $$Return.
                           return false;
//Tell Domino to execute the $$Return.
Note: Since SaveOptions are set to "0", the doc collection will not be saved, and $$Return will be executed next.

Required fields on the form would be $$Return, SaveOptions, and Query in addition to the fields you provide your user with to search.

Dig Deeper on Lotus Notes Domino Administration Tools

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials'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 ...