Answers.Body: <p>You could always use the <a href="https://craftcms.com/docs/templating/craft.request#getPost" rel="nofollow noreferrer">Craft request object</a> to repopulate the fields, however I don't think it's common practice to repopulate password fields for security reasons.</p>
  
  <p>Another thing that is considered bad practice is differentiating behaviour for partially correct credentials - the response from the web server should always be the same whether one part or multiple parts are missing from a correct authorization submission to prevent information disclosure to a potential attacker.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-20T09:28:16.443Z
Answers.Text: Andris, i tried craft.request.getParam('password') and that works, but i also rethink with your advice and do not repopulate the password-field. Tnx!
Answers.UserDisplayName: d3nn15
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-18T05:39:07.190Z
Answers.LastActivityDate: 2017-09-18T05:39:07.190Z
Answers.UserDisplayName: Andris Sevcenko
Body: <p>I want to customize the user-registration-form with error/success-states.<br>
  If, for example, the user enters a wrong email, but correct username and password, it would be nice to set the value of the password input field back to the original entered password - like the username-field does.</p>
  
  <pre><code>{% if account is defined %}
  &lt;input id="password" name="password" type="password" value="{{account.password}}"&gt;
  {% endif %}
  </code></pre>
  
  <p>In matter of UX, this does not really works good, because it's the hashed version of the password. The origin was much shorter. So the user could be a bit surprised...<br>
  Not setting the value, but set the state to success with an empty field is not much better.</p>
  
  <p>Is it possible, to set the origin entered password as the value?<br>
  If, does this work on resend the form?<br>
  Any other ideas are welcome.</p>
  
  <p>Tnx</p>
  
  <p><a href="https://i.sstatic.net/bh1gj.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/bh1gj.png" alt="enter image description here"></a></p>
  
Tags: <users><registration><password>
Title: How to get the original entered password value on registration form error?
ThreadText: # How to get the original entered password value on registration form error?
  
  (Asked by: username_0 on 2017-09-17)
  
  I want to customize the user-registration-form with error/success-states.  
  If, for example, the user enters a wrong email, but correct username and password, it would be nice to set the value of the password input field back to the original entered password - like the username-field does.
  
  ```
  {% if account is defined %}
  <input id="password" name="password" type="password" value="{{account.password}}">
  {% endif %}
  
  ```
  
  In matter of UX, this does not really works good, because it's the hashed version of the password. The origin was much shorter. So the user could be a bit surprised...  
  Not setting the value, but set the state to success with an empty field is not much better.
  
  Is it possible, to set the origin entered password as the value?  
  If, does this work on resend the form?  
  Any other ideas are welcome.
  
  Tnx
  
  [![enter image description here](https://i.sstatic.net/bh1gj.png)](https://i.sstatic.net/bh1gj.png)
  
  **Tags:** users, registration, password
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-09-18. Score: 3 | Accepted answer
  
  You could always use the [Craft request object](https://craftcms.com/docs/templating/craft.request#getPost) to repopulate the fields, however I don't think it's common practice to repopulate password fields for security reasons.
  
  Another thing that is considered bad practice is differentiating behaviour for partially correct credentials - the response from the web server should always be the same whether one part or multiple parts are missing from a correct authorization submission to prevent information disclosure to a potential attacker.
  
  > **Comments:**
  > **username_0**: username_1, i tried craft.request.getParam('password') and that works, but i also rethink with your advice and do not repopulate the password-field. Tnx!  
  
  ---
  
  