How can I cater for the ENTER event for my $$Search form?

Hi all,

I have created a customized $$Search with the following:

(1) Search button

On the Search button “onClick” event, I have written a Javascrip segment to submit for the search results and this works fine:

var target;

target = (target == null ) ? window : target ;

key= document.forms[0].Query.value

url = “/home.nsf/AllDocuments?SearchView&Query=” + key ;

target.location.href = url;

(2 Query field

However, I trap the Carriage Return event in the “onKeyDown” eveny for this field to use the same code segment and it does not work:-

if (event.keycode == 13){

var target;

target = (target == null ) ? window : target ;

key= document.forms[0].Query.value

url = “/home.nsf/AllDocuments?SearchView&Query=” + key ;

target.location.href = url;

}

Whenever, I hit ENTER key, it gave a “From Processed” page instead.

Can all JavaScript gurus here advise me how I can reconcile this?

Many thanks in advance!

Teck Lung

Subject: I found a few answers in this forum

http://www-10.lotus.com/ldd/nd6forum.nsf/Search?SearchView&Query=keycode%20and%20submit&SearchOrder=0&Start=1&Count=100

Subject: Many thanks, Carl, your search link is very helpful!!! =)

this missing “return false” in my function really made a lot of difference!!!

Thanks again, Carl.

Cheers!

Teck Lung