使用jQuery_validate插件时遇到的问题(一)
来源:互联网 发布:淘宝旺旺如何设置 编辑:程序博客网 时间:2024/04/30 15:44
问题描述:jQuery_validate配置后无论怎样都看不到提示信息。
原因:submit()了二次。
例子:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><%@ taglib prefix="s" uri="/struts-tags" %><html><head><title>jquery test</title><script src="js/jquery.js"></script><script src="js/jquery.validate.js"></script><script src="js/jquery.metadata.js"></script><script src="js/messages_zh.js"></script><script>$(document).ready(function() {$("#commentForm").validate({ //debug:true });});</script><script type="text/javascript"> function register(){ document.forms[0].action = 'register/addUser.action'; //document.forms[0].submit(); }</script></head><body > <form id="commentForm" method="post"> <table style ="width:100%"> <tr> <td>user name:</td> <td><input type="text" name="username" id="username" maxlength="10"class="{required:true,minlength:6,maxlength:12}" /></td> </tr> <tr> <td>password:</td> <td><input type="password" name="password" id="password" maxlength="15"class="required"/></td> </tr> <tr> <td></td> <td><input type="submit" value="Register" onclick="register();"></td> </tr> </table> </form></body></html>
jQuery验证后有个提交,自己在register()中又提交了一次,将【document.forms[0].submit();】注释掉后问题解决。
- 使用jQuery_validate插件时遇到的问题(一)
- eclipse插件应用中遇到的问题汇总(一)
- 使用struts2 convention插件遇到的问题
- Eclipse git 插件使用遇到的问题
- jquery_validate
- 新手使用React时遇到的问题整理<一>
- 新手使用React时遇到的问题整理<一>
- 使用arcgis server manager 遇到的问题(一)
- SCFF使用中遇到的问题(一)
- PagerSlidingTabStrip使用遇到的问题一
- mongoose使用中遇到的问题一:
- Elipse CDT 插件时遇到的问题
- sublime 安装插件时遇到的问题
- MobileSelect联动插件的使用和遇到的问题总结
- 使用jQuery插件qtip遇到的位置问题
- VIM插件使用过程中遇到的问题
- 在MyEclipse中使用ClearCase插件及遇到的问题
- 使用swiper插件过程中遇到的问题
- 证书加密并控制证书权限测试步骤
- Debian 6.0.6 系统安装第十三步: 安装WINE
- SC44B0的内存地址解析
- sap学习天地
- 12306网购火车票技巧春节订票技巧
- 使用jQuery_validate插件时遇到的问题(一)
- AS3.0杂记——Vector与Array的比美
- C# 存储过程分页
- 关于报错 'Could not instantiate class named NSLayoutConstraint
- C#中容器控件GroupBox、Panel、TabControl的应用
- 说说JSON和JSONP,也许你会豁然开朗,含jQuery用例
- OpenCL开发案例学习
- buntu和XP互相远程连接
- hibernate中Query的用法