'thisEvent' not found runtime error

I have a search XPage with one EditBox. It performs a full text search and updates a view control. I’m trying to use the box’s onkeypress event to make sure the search is not performed until the user presses Enter. The (server side only) onkeypress code is

var query = getComponent(“inputText1”).getValue();

if(query==‘’){

sessionScope.put(“queryString”,“”);

}

else{

sessionScope.put(“queryString”,query);

}

return (thisEvent.keyCode == ‘13’);

When I press any key I get a runtime error as follows:

Script interpreter error, line=10, col=27: [ReferenceError] ‘thisEvent’ not found

The line it’s complaining about is:

return (thisEvent.keyCode == ‘13’);

How do I make this work?

Subject: get enter-key client-side

HiIn the client-side javaScript of the onkeypress-Event i use this:

if (thisEvent.keyCode != ‘13’){

return false;

} else {

//server-side script will be executed

}

With this client-side javascript the ssjs will only be executed, when the user hits the enter-key.