天堂1八大长老怎么走:我的网页中form中不能按回车

来源:百度文库 编辑:高考问答 时间:2024/04/28 22:15:42
<form><input tabIndex="1" type="text" name="inputxinghao" style="BORDER-RIGHT: #b4b4b4 1px double; BORDER-TOP: #b4b4b4 1px double; BORDER-LEFT: #b4b4b4 1px double; COLOR: #8888aa; BORDER-BOTTOM: #b4b4b4 1px double; BACKGROUND-COLOR: #ffffff" size=10 > </td>
<td width="46%" align="center"><select name="selecta" size="1" tabIndex="2">
<option value="1" selected>新型号</option>
<option value="0">旧型号</option>
</select><div align="center"></div></td>
</tr>
<tr align="center" valign="bottom">
<td height="25" colspan="2"><input tabIndex="3" src="../image/index-12.gif" width="43" height="24" type="image" name="tijiao" onclick="javascript: return CheckForm();"></td>
</tr>
</table>
</form>

form表单中不能按回车,点击能提交,请问如果按回车就能提交应该怎么办啊

在form中加一个事件onkeydown, 判断健值, 如果是回车健就提交表单, 试试:

<form action=search.asp onkeydown="if(event.keyCode==13) document.all.form1.submit();" name=form1><input tabIndex="1" type="text" name="inputxinghao" style="BORDER-RIGHT: #b4b4b4 1px double; BORDER-TOP: #b4b4b4 1px double; BORDER-LEFT: #b4b4b4 1px double; COLOR: #8888aa; BORDER-BOTTOM: #b4b4b4 1px double; BACKGROUND-COLOR: #ffffff" size=10 > </td>
<td width="46%" align="center"><select name="selecta" size="1" tabIndex="2">
<option value="1" selected>新型号</option>
<option value="0">旧型号</option>
</select><div align="center"></div></td>
</tr>
<tr align="center" valign="bottom">
<td height="25" colspan="2"><input tabIndex="3" src="../image/index-12.gif" width="43" height="24" type="image" name="tijiao" onclick="javascript: return CheckForm();"></td>
</tr>
</table>
</form>