求助,一个JSP页面中有两个FORM,JS就实现不了..
<!-- 搜索部分 -->
<div id="searchBox" style="width: 270px;">
<form action="Student_getByKeyWord" method="post">
<input type="text" name="keyWord">
<input type="submit" value="搜索">
<a href="javascript:;" id="show"><input type="button" value="添加"></input></a>
</form>
</div>
------------------------------
<!-- 弹窗部分 -->
<form action="Student_save">
<table class="popWindow" style="width:600px" cellspacing="0">
<th>添加个人信息<span>×</span></th>
<tr>
<td>
<div style=float:left>
姓名:<input type="text" name="name" placeholder="请输入姓名"
onblur="checkName(this)" />
<div>姓名必须是两位到四位汉字组成.</div>
</div>
<div style=float:right class="errorinfo" id="namediv">格式错误,请重新输入.</div>
</td>
</tr>
<tr>
<td><input type="submit" value="保存" id="btn_save" disabled="true">
<a href="Student_findAll"><input type="button" value="返回">
</a>
</td>
</tr>
</table>
</form>
-------------------------------
JS部分
// 选中框变色
function inputColor(input) {
input.className = "norm";
input.onfocus = function() {
this.className = "focus";
}
}
// 选中框变色
window.onload = function() {
with (document.forms[0]) {
inputColor(name);
// inputColor(account);
// inputColor(mail);
// inputColor(password);
// inputColor(repassword);
}
}
---------------------------------
想实现的功能是当鼠标点击文本框时,文本框边框变色.
运行发现不能实现,去掉搜索的FROM变成单个添加FROM就实现了.