回车提交表单

 
js里面这样写

function KeyDown()
{
   
       // 当按下“回车键”时执行Submit事件
        if (window.event.keyCode == 13)
        {                                    
                       document.getElementById("ic").onclick);            
           } 
}


引用的地方<input name="ticket" id="ti" class="input1" size="4" onkeydown="KeyDown()" >

<img id="ic" src="<%=request.getContextPath()%>/images/pic025a.gif" width="62" height="22" onClick="return toform()"/>

你可能感兴趣的:(回车提交表单)