表单中,的问题

来源:百度知道 编辑:UC知道 时间:2024/05/16 11:25:33
我的
<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=

<select name="selecta" size="1" tabIndex="2" onkeydown="checkkey()">
然后在上面javascript中再添加一个function checkkey()用来检查按下的键,如果是回车就调用提交过程.

你要加一个事件,当按下回车时,就提交到javascript: return CheckForm();
这样就可以了

在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">旧型号</opt