[code="javaScript"]
function checkForm() {
if (UserForm.name.value == "") {
alert("用户名称不能为空!!");
UserForm.name.focus();
return false;
}
if (document.getElementById("password").value == "") {
alert("用户密码不能为空!!");
document.getElementById("password").focus();
return false;
}
if (UserForm.realName.value == "") {
alert("名字不能为空!!");
UserForm.realName.focus();
return false;
}
if (UserForm.age.value == "") {
alert("用户年龄不能为空!!");
UserForm.age.focus();
return false;
}
if (UserForm.email.value == "") {
alert("用户邮箱不能为空!!");
UserForm.email.focus();
return false;
}
}
[/code]
[code="html"]
<%@ page pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
-Choice- |
[/code]
这段代码,在IE中能够正常使用,可是用火狐就没点用了,请问该怎么解决这浏览器之间的不兼容的问题啊?
我还是刚学js的,很多都不懂,请js高手多多指教!