title: refresh input after ajax submit form
body: <p>I searched all over but couldn't find how to refresh specific input field via js/jquery/ajax.</p>
  
  <p>This my input that change on every post :</p>
  
  <pre><code>&lt;input type='hidden' id='nonce' name='nonce' value=''&gt;
  &lt;input type='hidden' id='key' name='key' value=''&gt;
  </code></pre>
  
  <p>I need after ajax form submit to refresh this inputs, any idea?</p>
  
  <p>A better explanation :
  This php code generates random hashed keys.</p>
  
  <pre><code>&lt;form action="#"&gt;
  
  &lt;?php $n-&gt;generateFormFields() ?&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>I send this generated key via ajax POST, the problem is when I send the code to the ajax, the key changes in server side, so after next submit the key will be wrong because it didn't change after the ajax response, so I need to refresh this code after ajax submit/ refresh the inputs above.</p>
  
  <p><strong>edit 2 :</strong></p>
  
  <p>I am using this php script :</p>
  
  <p><a href="http://github.com/greatwitenorth/php-nonce" rel="nofollow">http://github.com/greatwitenorth/php-nonce</a></p>
  
  <p>The script is working on php POST, but I am using AJAX post so I need to refresh the keys with ajax somehow.</p>
  
  <p><strong>edit 3:</strong></p>
  
  <p>The form ex:</p>
  
  <pre><code>&lt;form action="#"&gt;
  
  &lt;?php $n-&gt;generateFormFields() ?&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>The php function above is creating Hashed keys.
  These hashed keys I send via ajax json POST, after I send them, I verify that the key is the same as the database key . - if ok continue, if not show error.
  now the problem is the key changes every time the form submitted. So it changes but in the input on the form, its not changed because ajax is not refreshing the page, so it will be sending the same key value that was before.</p>