开发者

Make a textbox click a button if you hit enter

So I have looked at some previous example online and开发者_如何学C it seems prettys strait forward

    <form:input path="searchParameter.instanceName" id="searchBox" onkeydown="if (event.keyCode == 13){ document.getElementById('btnSearch').click() return false }"/>

And it works fine with firefox but it does not work at all with I.E. 7 it just submits the form. Any idea wh


You seem to be missing a semicolon.

document.getElementById('btnSearch').click(); return false ;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜