title: While using struts html tags, How do I get the value of a textbox using its property attribute? Is there any other way to get the value?
body: <pre><code>    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();
      }
  
  
      &lt;form id="loginform" action="login.do" method="post"&gt;
      UserName:&lt;html:text property="userName"&gt;&lt;/html:text&gt;
      PassWord:&lt;html:password property="passWord"&gt;&lt;/html:password&gt;
      &lt;html:button onclick="validate()"&gt;&lt;/html:button&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>the above code is not working and I am unable to get the values in textbox for validation... Please help me out in this issue...</p>