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