function validate(){
var username = document.getElementByProperty("userName").value;
var password = document.getElementByProperty("passWord").value;
if((username == null ||username =='') || (password == null||password=='')){
x=document.getElementById("error");
x.innerHTML = "Username or Password Cannot Be Blank";
else{
document.getElementById("loginform").submit();
}
<form id="loginform" action="login.do" method="post">
UserName:<html:text property="userName"></html:text>
PassWord:<html:password property="passWord"></html:password>
<html:button onclick="validate()"></html:button>
</form>
上記のコードが機能せず、検証のためにテキストボックスの値を取得できません...この問題で私を助けてください...