Javascript 在java脚本中按enter键时执行查询

Javascript 在java脚本中按enter键时执行查询,javascript,Javascript,我想执行我的搜索按钮后面的代码按回车键。任何建议都将是伟大的 <html:text property="choiceValue" styleId="gestel999" onkeypress="return updateEnter(event,'refreshPage(this)')" style="margin-top:15px;" size="25"/> function updateEnter(e,refreshPage){ if(ee.keyC

我想执行我的搜索按钮后面的代码按回车键。任何建议都将是伟大的

    <html:text property="choiceValue" styleId="gestel999" onkeypress="return updateEnter(event,'refreshPage(this)')" style="margin-top:15px;" size="25"/>




function updateEnter(e,refreshPage){
        if(ee.keyCode == 13 || e.which == 13){
            refreshPage()
  }
}

现在,当您单击按钮或在焦点位于文本字段时使用Enter键时,将调用相同的操作。

可能是您可以开始实现代码…哪个按钮。。??到目前为止你都试了些什么。?把你的密码寄出去。?你在哪里试过?也许我只是累了,但这个问题让我大笑起来,因为按钮后面的代码可能是任何东西。向我们展示您的代码,并清楚、详细地告诉我们您正试图实现的目标,或者没有人可以帮助您。这是您的朋友。您不妨问一个新问题。由于没有足够快地提供代码和完全错误的编程语言标记,您破坏了这一点。
ActionListen al = new ActionListener()
{
    // implement ActionListener here
}

button.addActionListener( al );
textField.addActionListener( al );