在看看客户端源文件另一部分
其中这一行
if (field.type == 'text' ||
field.type == 'textarea' ||
field.type == 'file' ||
field.type == 'select-one' ||
field.type == 'radio' ||
field.type == 'password') {就有 field.type == 'password'
---------------------------------------------------function validateRequired(form) {
var isValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oRequired = new required();
for (x in oRequired) {
var field = form[oRequired[x][0]];
if (field.type == 'text' ||
field.type == 'textarea' ||
field.type == 'file' ||
field.type == 'select-one' ||
field.type == 'radio' ||
field.type == 'password') {
var value = '';
// get field's value
if (field.type == "select-one") {
var si = field.selectedIndex;
if (si >= 0) {
value = field.options[si].value;
}
} else {
value = field.value;
}
if (trim(value).length == 0) {
if (i == 0) {
focusField = field;
}
fields[i++] = oRequired[x][1];
isValid = false;
}
}
}
if (fields.length > 0) {
focusField.focus();
alert(fields.join('\n'));
}
return isValid;
}
其中这一行
if (field.type == 'text' ||
field.type == 'textarea' ||
field.type == 'file' ||
field.type == 'select-one' ||
field.type == 'radio' ||
field.type == 'password') {就有 field.type == 'password'
---------------------------------------------------function validateRequired(form) {
var isValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oRequired = new required();
for (x in oRequired) {
var field = form[oRequired[x][0]];
if (field.type == 'text' ||
field.type == 'textarea' ||
field.type == 'file' ||
field.type == 'select-one' ||
field.type == 'radio' ||
field.type == 'password') {
var value = '';
// get field's value
if (field.type == "select-one") {
var si = field.selectedIndex;
if (si >= 0) {
value = field.options[si].value;
}
} else {
value = field.value;
}
if (trim(value).length == 0) {
if (i == 0) {
focusField = field;
}
fields[i++] = oRequired[x][1];
isValid = false;
}
}
}
if (fields.length > 0) {
focusField.focus();
alert(fields.join('\n'));
}
return isValid;
}
解决方案 »
- S2SH 框架 Web项目 空指针问题
- 学软件刚出来的孩子,有点迷茫
- 跳转前加一个操作成功的对话框
- (急)java中截取字符串
- struts2的小实验 但是tomcat报错了
- 问个小问题.为什么我用myeclipse debug调试的时候非常卡 有阵子很畅快,如何解决
- 使用StringBuffer时出现java.lang.OutOfMemoryError错误,请高手指教
- 安装roller以后日期变"aa-n-j"的奇怪问题
- 在struts中能不能把一篇文章按原本的格式存入数据库,然后再读出来显示在网页上?
- 有状态会话BEAN连接数据库的问题--超级难道,有代码
- java specification到底看哪个?
- 跪求~!jdbc
问题就出在validateMask中没有对field.type == 'password'的判断这个问题怎么解决?