title: Update hidden input field value with another input field value?
body: <p>I am trying to update one hidden input field with another visible input field using javascript...</p>
  
  <p>but my code doesn't work for some reason!!</p>
  
  <p>This is my javascript:</p>
  
  <pre><code>&lt;script language="javascript"&gt;
      function process1() {
          document.getElementById("sum_total").value = (document.getElementById("my-item-price").value);
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>And This Is My form code:</p>
  
  <pre><code>&lt;form&gt;&lt;input name="A1" type="text" class="A1" id="A1"/&gt;&lt;/form&gt;
  
  &lt;form&gt;&lt;input type="hidden" id="A2" name="A2" value="process1() "/&gt;&lt;/form&gt;
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <pre><code>&lt;script language="javascript"&gt; 
      function process1() { 
          document.getElementById("sum_total").value = (document.getElementById("my-item-price").value); 
      } 
  &lt;/script&gt;
  </code></pre>