#35 解决bootstrap + JQuery Validation时出错信息被强制换行的问题
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<html>
|
||||
<head>
|
||||
<title>用户注册</title>
|
||||
<title>用户管理</title>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
@@ -11,7 +11,7 @@
|
||||
$("#name").focus();
|
||||
//为inputForm注册validate函数
|
||||
$("#inputForm").validate({
|
||||
|
||||
errorElement: "span"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
<title>登录页</title>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("#loginForm").validate();
|
||||
$("#loginForm").validate({
|
||||
errorElement: "span"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
@@ -49,7 +51,7 @@
|
||||
<div class="controls">
|
||||
<label class="checkbox" for="rememberMe"><input type="checkbox" id="rememberMe" name="rememberMe"/> 记住我</label>
|
||||
<input id="submit_btn" class="btn btn-primary" type="submit" value="登录"/> <a class="btn" href="${ctx}/register">注册</a>
|
||||
<span class="help-block">(登录帐号:<b>admin/admin</b>,<b>user/user</b>)</span>
|
||||
<span class="help-block">(管理员: <b>admin/admin</b>, 普通用户: <b>user/user</b>)</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<html>
|
||||
<head>
|
||||
<title>用户注册</title>
|
||||
<title>资料修改</title>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
@@ -11,7 +11,7 @@
|
||||
$("#name").focus();
|
||||
//为inputForm注册validate函数
|
||||
$("#inputForm").validate({
|
||||
|
||||
errorElement: "span"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
$("#loginName").focus();
|
||||
//为inputForm注册validate函数
|
||||
$("#inputForm").validate({
|
||||
errorElement: "span",
|
||||
rules: {
|
||||
loginName: {
|
||||
remote: "${ctx}/register/checkLoginName"
|
||||
|
||||
@@ -9,9 +9,11 @@
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
//聚焦第一个输入框
|
||||
$("#title").focus();
|
||||
$("#task_title").focus();
|
||||
//为inputForm注册validate函数
|
||||
$("#inputForm").validate();
|
||||
$("#inputForm").validate({
|
||||
errorElement: "span"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
@@ -22,15 +24,15 @@
|
||||
<fieldset>
|
||||
<legend><small>管理任务</small></legend>
|
||||
<div class="control-group">
|
||||
<label for="task.title" class="control-label">任务名称:</label>
|
||||
<label for="task_title" class="control-label">任务名称:</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="task.title" name="title" value="${task.title}" class="input-large required" minlength="3"/>
|
||||
<input type="text" id="task_title" name="title" value="${task.title}" class="input-large required" minlength="3"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label for="task.description" class="control-label">任务描述:</label>
|
||||
<label for="description" class="control-label">任务描述:</label>
|
||||
<div class="controls">
|
||||
<textarea id="task.description" name="description" class="input-large">${task.description}</textarea>
|
||||
<textarea id="description" name="description" class="input-large">${task.description}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
label.error {
|
||||
span.error {
|
||||
background:url("images/unchecked.gif") no-repeat 0px 0px;
|
||||
padding-left: 16px;
|
||||
padding-bottom: 2px;
|
||||
|
||||
+3
-3
@@ -41,17 +41,17 @@ public class TaskGuiFT extends BaseSeleniumTestCase {
|
||||
s.click(By.linkText("创建任务"));
|
||||
|
||||
Task task = TaskData.randomTask();
|
||||
s.type(By.id("task.title"), task.getTitle());
|
||||
s.type(By.id("task_title"), task.getTitle());
|
||||
s.click(By.id("submit_btn"));
|
||||
|
||||
assertTrue(s.isTextPresent("创建任务成功"));
|
||||
|
||||
//update
|
||||
s.click(By.linkText(task.getTitle()));
|
||||
assertEquals(task.getTitle(), s.getValue(By.id("task.title")));
|
||||
assertEquals(task.getTitle(), s.getValue(By.id("task_title")));
|
||||
|
||||
String newTitle = TaskData.randomTitle();
|
||||
s.type(By.id("task.title"), newTitle);
|
||||
s.type(By.id("task_title"), newTitle);
|
||||
s.click(By.id("submit_btn"));
|
||||
assertTrue(s.isTextPresent("更新任务成功"));
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
//为inputForm注册validate函数
|
||||
$("#inputForm").validate({
|
||||
errorElement: "span",
|
||||
rules: {
|
||||
loginName: {
|
||||
remote: "${ctx}/account/user/checkLoginName?oldLoginName=" + encodeURIComponent('${user.loginName}')
|
||||
@@ -40,19 +41,19 @@
|
||||
<div class="control-group">
|
||||
<label for="loginName" class="control-label">登录名:</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="loginName" name="loginName" value="${user.loginName}" class="input-medium required"/>
|
||||
<input type="text" id="loginName" name="loginName" value="${user.loginName}" class="input-large required"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label for="name" class="control-label">用户名:</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="name" name="name" value="${user.name}" class="input-medium required"/>
|
||||
<input type="text" id="name" name="name" value="${user.name}" class="input-large required"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label for="plainPassword" class="control-label">密码:</label>
|
||||
<div class="controls">
|
||||
<input type="password" id="plainPassword" name="plainPassword" class="input-medium"/>
|
||||
<input type="password" id="plainPassword" name="plainPassword" class="input-large" placeholder="...Leave it blank if no change"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<div class="controls">
|
||||
<label class="checkbox inline" for="rememberMe"> <input type="checkbox" id="rememberMe" name="rememberMe"/> 记住我</label>
|
||||
<input id="submit_btn" class="btn" type="submit" value="登录"/>
|
||||
<p class="help-block">(管理员<b>admin/admin</b>, 普通用户<b>user/user</b>)</p>
|
||||
<p class="help-block">(管理员:<b>admin/admin</b>, 普通用户:<b>user/user</b>)</p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Web Service 演示</h2>
|
||||
<h1>Web Service 演示</h1>
|
||||
|
||||
<h2>传统SOAP Web Service演示</h2>
|
||||
<ul>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
label.error,span.error{
|
||||
span.error{
|
||||
background:url("images/unchecked.gif") no-repeat 0px 0px;
|
||||
padding-left: 16px;
|
||||
padding-bottom: 2px;
|
||||
|
||||
Reference in New Issue
Block a user