title: How do you clear a form after struts validation error
body: <p>I have a form (JSP) and I'm using Struts to validate the text fields. An example would be to display an error if the user enters numbers inside of the <code>First name</code> text box since it will only accept letters. The message stays on the screen along with the numbers. When you right click and do a view source code, you can see the numbers there as if they're hard coded. </p>
  
  <p>I have a <code>html:reset</code> button but it won't clear the numbers out of the text box. If you click on the text box and clear the numbers manually after the validation error, then click the <strong>Reset</strong> button, it puts the numbers right back in. I have tried many different pieces of code using the DOCUMENTS class with a function inside of a script tag. Here is one of many pieces of code I've tried:</p>
  
  <pre><code> &lt;input type="button" value="Clear Form" onclick="clearForm()"/&gt; 
  
   &lt;script type="text/JavaScript"&gt;
       function clearForm() {
       document.getElementById("FirstName").value=" ";  }
   &lt;/script&gt;
  </code></pre>
  
  <p>I have also tried the get elements by class name and also by tag name methods but nothing is working. </p>
  
  <p>My first name text box id is <code>FirstName</code>. The jsp is using HTML with Struts. Any help will be appreciated and if anyone who is willing needs more information I will provide it. Thank you all. </p>