开发者

Make a textbox click a button if you hit enter

开发者 https://www.devze.com 2023-04-07 00:43 出处:网络
So I have looked at some previous example online and开发者_如何学C it seems prettys strait forward

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

精彩评论

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