这是我正在尝试进行的留言簿验证。标签中的文本<p>
没有改变,我不知道为什么。你能帮我验证这个表格吗:
function Frmvalidate() {
var nmchk = document.forms["guestform1"]["name"].value;
var cmntchk = document.forms["guestform1"]["comment"].value;
if (nmchk == null || nmchk == "") {
var namep = document.getElementById("namep");
x.innerHTML = "name must be filled out";
return false;
} else {
return true;
}
if (cmntchk == null || cmntchk == "") {
var cmntp = document.getElementById("cmntp");
x.innerHTML = "comment must be filled out";
return false;
} else {
return true;
}
}