title: Javascript error: function expected
body: <p>I have this javascript and I get the error "function expected". I can't see anything wrong with my javascript. Please help. Thanks.</p>
  
  <pre><code>function checkrewardname()
  {
  var my=document.getElementById("Rname");
  var con=my.value;
   var mine=document.getElementById("forref").value.split('\n');
  
  if (con == "")
          {
              alert("Enter a Reward Name.");
      }
   else
      { 
      var i=0;
      while(i&lt;=mine.length)
           {
              if (mine(i) == con)//error here
                  {
                      alert("Duplicate reward. Please enter a new reward.");
                  }
              else
                  {
                      document.getElementById("validate").click();
                      alert("The reward has been saved.");
                  }
              i++;
          }   
       }
  }`
  </code></pre>