title: Copying value from one input field to another input field
body: <p>I need a javascript function for copying the value of one input field to another input field based on checkbox selection. However i did some javascript code on click,</p>
  
  <pre><code>&lt;script&gt;    
  function copyTextValue() {
      var text1 = document.getElementById("Name1").value;
      document.getElementById("Name2").value = text1;
      document.getElementById("Name3").value=text1;
  }
  &lt;/script&gt;
  
  &lt;input type="checkbox" name="check1" onclick="copyTextValue();"/&gt;
  </code></pre>
  
  <p>Now i need to delete the copied values in those two boxes on uncheck. I stuck up with this. Any help?</p>