为什么第一次按回车不能提交执行内容?
为什么我载入页面后,在文本框内第一次输入关键字,按回车不能搜索,必须鼠标按submit按钮才可以,但再次输入其他关键字,按回车就可以搜索了。请教如何解决?
主要代码如下:
<Script language= "VBScript ">
<!--
sub tj()
if form1.type1.value= "a " then
form1.action= "a.asp "
else
form1.action= "b.asp "
End if
form1.submit
end sub
-->
</script>
<form method= "get " name= "form1 " target= "bv ">
<table width= "100% " border= "0 " cellpadding= "0 " cellspacing= "0 " bgcolor= "#FFFFFF ">
<tr>
<td height= "20 " align= "center "> 闪存类别: </td>
<td height= "20 "> <select name= "type1 ">
<option value= "a "> 产品 </option>
<option value= "b "> 文章 </option>
</select> </td>
</tr>
<tr>
<td width= "80 " height= "20 " align= "center "> 关键字: </td>
<td height= "20 "> <input name= "p_name " type= "text " class= "form "> </td>
</tr>
<tr>
<td height= "20 "> </td>
<td height= "20 "> <input name= "提交 " type= "submit " value= "搜索 " onClick= "tj() "> </td>
</tr>
</table>
</form>
<table>
<tr>
<td width= "649 " valign= "top "> <IFRAME border=0 name=bv src= "cover.asp " frameBorder=0 width=649 height= "400 " scrolling=no onload=init()> </IFRAME>
</td>
</tr>
</table>
------解决方案---------