From e2d599f8cf7e6da92603883bdba2d4f54bf7da30 Mon Sep 17 00:00:00 2001 From: Calvin Date: Mon, 3 Sep 2012 16:34:24 +0800 Subject: [PATCH] =?UTF-8?q?jquery=20validate=20+=20Bootstraper=20=E5=B0=86?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC=E6=94=BE=E5=88=B0message=5Fbs=5Fcn?= =?UTF-8?q?=E4=B8=AD=EF=BC=8C=E4=B8=8D=E9=9C=80=E8=A6=81=E6=AF=8F=E6=AC=A1?= =?UTF-8?q?=E8=AE=BE=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../quickstart/src/main/webapp/WEB-INF/layouts/default.jsp | 2 +- .../src/main/webapp/WEB-INF/views/account/adminUserForm.jsp | 4 +--- .../src/main/webapp/WEB-INF/views/account/login.jsp | 4 +--- .../src/main/webapp/WEB-INF/views/account/profile.jsp | 4 +--- .../src/main/webapp/WEB-INF/views/account/register.jsp | 1 - .../src/main/webapp/WEB-INF/views/task/taskForm.jsp | 4 +--- .../1.9.0/{messages_cn.js => messages_bs_cn.js} | 6 +++++- .../src/main/webapp/WEB-INF/views/account/userForm.jsp | 6 +++--- examples/showcase/src/main/webapp/WEB-INF/views/login.jsp | 4 +--- .../1.9.0/{messages_cn.js => messages_bs_cn.js} | 6 +++++- 10 files changed, 19 insertions(+), 22 deletions(-) rename examples/quickstart/src/main/webapp/static/jquery-validation/1.9.0/{messages_cn.js => messages_bs_cn.js} (93%) rename examples/showcase/src/main/webapp/static/jquery-validation/1.9.0/{messages_cn.js => messages_bs_cn.js} (93%) diff --git a/examples/quickstart/src/main/webapp/WEB-INF/layouts/default.jsp b/examples/quickstart/src/main/webapp/WEB-INF/layouts/default.jsp index e12ab02a..e44d9e92 100644 --- a/examples/quickstart/src/main/webapp/WEB-INF/layouts/default.jsp +++ b/examples/quickstart/src/main/webapp/WEB-INF/layouts/default.jsp @@ -18,7 +18,7 @@ - + diff --git a/examples/quickstart/src/main/webapp/WEB-INF/views/account/adminUserForm.jsp b/examples/quickstart/src/main/webapp/WEB-INF/views/account/adminUserForm.jsp index 6ffae83a..20316093 100644 --- a/examples/quickstart/src/main/webapp/WEB-INF/views/account/adminUserForm.jsp +++ b/examples/quickstart/src/main/webapp/WEB-INF/views/account/adminUserForm.jsp @@ -10,9 +10,7 @@ //聚焦第一个输入框 $("#name").focus(); //为inputForm注册validate函数 - $("#inputForm").validate({ - errorElement: "span" - }); + $("#inputForm").validate(); }); diff --git a/examples/quickstart/src/main/webapp/WEB-INF/views/account/login.jsp b/examples/quickstart/src/main/webapp/WEB-INF/views/account/login.jsp index f754c435..19105071 100644 --- a/examples/quickstart/src/main/webapp/WEB-INF/views/account/login.jsp +++ b/examples/quickstart/src/main/webapp/WEB-INF/views/account/login.jsp @@ -10,9 +10,7 @@ 登录页 diff --git a/examples/quickstart/src/main/webapp/WEB-INF/views/account/profile.jsp b/examples/quickstart/src/main/webapp/WEB-INF/views/account/profile.jsp index dca991fb..0701c7ea 100644 --- a/examples/quickstart/src/main/webapp/WEB-INF/views/account/profile.jsp +++ b/examples/quickstart/src/main/webapp/WEB-INF/views/account/profile.jsp @@ -10,9 +10,7 @@ //聚焦第一个输入框 $("#name").focus(); //为inputForm注册validate函数 - $("#inputForm").validate({ - errorElement: "span" - }); + $("#inputForm").validate(); }); diff --git a/examples/quickstart/src/main/webapp/WEB-INF/views/account/register.jsp b/examples/quickstart/src/main/webapp/WEB-INF/views/account/register.jsp index f17db1ee..45c5356a 100644 --- a/examples/quickstart/src/main/webapp/WEB-INF/views/account/register.jsp +++ b/examples/quickstart/src/main/webapp/WEB-INF/views/account/register.jsp @@ -11,7 +11,6 @@ $("#loginName").focus(); //为inputForm注册validate函数 $("#inputForm").validate({ - errorElement: "span", rules: { loginName: { remote: "${ctx}/register/checkLoginName" diff --git a/examples/quickstart/src/main/webapp/WEB-INF/views/task/taskForm.jsp b/examples/quickstart/src/main/webapp/WEB-INF/views/task/taskForm.jsp index 82a78a4b..157e61bc 100644 --- a/examples/quickstart/src/main/webapp/WEB-INF/views/task/taskForm.jsp +++ b/examples/quickstart/src/main/webapp/WEB-INF/views/task/taskForm.jsp @@ -11,9 +11,7 @@ //聚焦第一个输入框 $("#task_title").focus(); //为inputForm注册validate函数 - $("#inputForm").validate({ - errorElement: "span" - }); + $("#inputForm").validate(); }); diff --git a/examples/quickstart/src/main/webapp/static/jquery-validation/1.9.0/messages_cn.js b/examples/quickstart/src/main/webapp/static/jquery-validation/1.9.0/messages_bs_cn.js similarity index 93% rename from examples/quickstart/src/main/webapp/static/jquery-validation/1.9.0/messages_cn.js rename to examples/quickstart/src/main/webapp/static/jquery-validation/1.9.0/messages_bs_cn.js index 8415f4ad..6777e2eb 100644 --- a/examples/quickstart/src/main/webapp/static/jquery-validation/1.9.0/messages_cn.js +++ b/examples/quickstart/src/main/webapp/static/jquery-validation/1.9.0/messages_bs_cn.js @@ -20,4 +20,8 @@ jQuery.extend(jQuery.validator.messages, { range: jQuery.validator.format("请输入一个介于 {0} 和 {1} 之间的值"), max: jQuery.validator.format("请输入一个最大为 {0} 的值"), min: jQuery.validator.format("请输入一个最小为 {0} 的值") -}); \ No newline at end of file +}); + +jQuery.extend(jQuery.validator.defaults, { + errorElement: "span" +}); \ No newline at end of file diff --git a/examples/showcase/src/main/webapp/WEB-INF/views/account/userForm.jsp b/examples/showcase/src/main/webapp/WEB-INF/views/account/userForm.jsp index e2ae26a0..502798bd 100644 --- a/examples/showcase/src/main/webapp/WEB-INF/views/account/userForm.jsp +++ b/examples/showcase/src/main/webapp/WEB-INF/views/account/userForm.jsp @@ -7,6 +7,7 @@ 综合演示用例 + diff --git a/examples/showcase/src/main/webapp/static/jquery-validation/1.9.0/messages_cn.js b/examples/showcase/src/main/webapp/static/jquery-validation/1.9.0/messages_bs_cn.js similarity index 93% rename from examples/showcase/src/main/webapp/static/jquery-validation/1.9.0/messages_cn.js rename to examples/showcase/src/main/webapp/static/jquery-validation/1.9.0/messages_bs_cn.js index 8415f4ad..6777e2eb 100644 --- a/examples/showcase/src/main/webapp/static/jquery-validation/1.9.0/messages_cn.js +++ b/examples/showcase/src/main/webapp/static/jquery-validation/1.9.0/messages_bs_cn.js @@ -20,4 +20,8 @@ jQuery.extend(jQuery.validator.messages, { range: jQuery.validator.format("请输入一个介于 {0} 和 {1} 之间的值"), max: jQuery.validator.format("请输入一个最大为 {0} 的值"), min: jQuery.validator.format("请输入一个最小为 {0} 的值") -}); \ No newline at end of file +}); + +jQuery.extend(jQuery.validator.defaults, { + errorElement: "span" +}); \ No newline at end of file