表单的焦点tap键顺序:tabindex决定,如果值缺省,择按顺序用户:<input name=text1 type=text tabindex=1 />密码:<input name=password1 type=password tabindex=2 >对应onsubmit事件即可:[html]<form action=<%=basepath%>common/userlogin.action method=post name=loginform id=loginform onsubmit=return subuser();><input src=<%=basepath%>scxt/image/home08.jpg type=image/></form>
注意return的用法。js: www.2cto.com[javascript]function subuser(){var username=$(#uname).val();var password=$(#upwd).val();var checkcode=$(#checkcode).val();if(username==){$(#msg).html(请输入用户名!);$(#uname).focus();return false;}else if(password==){$(#msg).html(请输入密码!);$(#upwd).focus();return false;}else if(checkcode==''){$(#msg).html(请输入验证码!);$(#checkcode).focus();return false;}else{document.loginform.submit();return false;}return false;}
表单获取焦点事件:$(”#nameinput”).focus()
高性能网站规划之缓存更新高性能网站规划之缓存更新写好“微博”的五大妙招以数据为中心的数据中心管理方法很多人在问了,小程序到底有哪一些优势呢?怎样挖掘网站关键词?什么样的关键词才是适合的?优化网站您的4个SEO步骤清单官方网站建设要注意的问题谈SEO和关键词排名