title: How to solve "object required" exception in javascript?
body: <p>I have written a simple Javascript function as follows: </p>
  
  <pre><code>function loginValidate(){
     var rValue = true;
     var username = document.getElementById("username").value; 
     var password = document.getElementById("password").value;
  
     if(username=="" || password==""){
        alert('Empty field');
        rValue = false;
     }
     return rValue;
     //alert('hi');
  }
  </code></pre>
  
  <p>When I hit the submit button I am getting the error as: 
  <strong>Object required : loginValidate.js line 3 character 3</strong></p>
  
  <p>I am getting the error on both <strong>IE 8 and FF 10</strong> but it works fine in Eclipse internal browser.</p>
  
  <p>Am I missing something? Kindly help, thanks in advance.</p>