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?