function shiquguangbiao(){
}
</script>
<input type="text" name="name" id="name" onblur="shiquguangbiao()">
你写的好复杂啊。其实最简单的办法就是为form表单增加一个submit类型的按钮,这样就能自动响应回车事件了。给你个示范吧
<form onsubmit="try{return per_submit(this)}catch(e){alert(e.message)return false}"><input type="text" name="contentKey" ... />
<input type="submit" .../>
<input type="hidden" .../>...
</form>
<script type="text/javascript">
function per_sumbit(formObj) {
var searchKey = formObj.contentKey.value
if (searchKey.length <1 || searchKey == '请输入关键字') {
formObj.contentKey.value = '请输入关键字'
return false
}
return true
}
</script>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)