<p>This is something you should let JavaScript take care of. Craft does not check a 'second' email or password field, so you should make sure the two field values are identical before posting the values to Craft's controller.</p>

CC BY-SA 3.0
2014-09-11T14:19:08.303Z
2014-09-11T14:19:08.303Z
Paul
<p>If anyone is interested in confirming passwords still, I have wrote a plugin which does just this, it doesn't rely on it's own controller either so there is no bypassing of Crafts own workings :)</p>

<p><a href="https://github.com/alecritson/Craft-Password-Confirm">https://github.com/alecritson/Craft-Password-Confirm</a></p>

<p>All you need to do is add a <code>passwordConfirm</code> field to your existing form:</p>

<pre><code>&lt;input type="password" name="passwordConfirm"&gt;
{% if account is defined %}
  {{ account.getErrors('passwordConfirm') }}
{% endif %}
</code></pre>

<p>It doesn't confirm emails though..sorry</p>

CC BY-SA 3.0
2017-03-09T18:21:06.163Z
This is great, and can easily be modified to support confirm email as well!
Rick Kukiela
CC BY-SA 3.0
2016-03-17T10:45:18.263Z
2016-03-17T10:45:18.263Z
Alec Ritson
<p>In addition to <a href="https://craftcms.stackexchange.com/a/2483/57">letting JavaScript</a> take care of the extra front-end logic, you could also write a <a href="http://buildwithcraft.com/docs/plugins/introduction" rel="nofollow noreferrer">plugin</a> that exposes a <a href="http://buildwithcraft.com/docs/plugins/controllers" rel="nofollow noreferrer">controller</a> that does the extra email and password sameness checks from PHP.</p>

<p>If those are equal, then it would just pass the data off to <code>craft()-&gt;users-&gt;saveUser()</code>, otherwise, return any validation errors back to the template.</p>

CC BY-SA 3.0
2014-09-12T15:24:50.987Z
Thanks Brad - will bear that in mind for the future if I ever manage to get my head around OO PHP :)
darylknight
CC BY-SA 3.0
2014-09-11T15:45:23.450Z
2014-09-11T15:45:23.450Z
2017-04-13T12:50:59.930Z
Brad Bell
<p>I've got a user registration form on my site, using the code from Craft's documentation. How can I get the form working so it asks the user to enter their email address and password twice? Can Craft take care of that or do I need to use client-side JS validation?</p>

<form><registration>
User registration: How do implement "Confirm password" and "Confirm email"?
# User registration: How do implement "Confirm password" and "Confirm email"?

(Asked by: username_0 on 2014-09-11)

I've got a user registration form on my site, using the code from Craft's documentation. How can I get the form working so it asks the user to enter their email address and password twice? Can Craft take care of that or do I need to use client-side JS validation?

**Tags:** form, registration


---

## 3 answers

### Answer by username_1 on 2014-09-11. Score: 3 | Accepted answer

This is something you should let JavaScript take care of. Craft does not check a 'second' email or password field, so you should make sure the two field values are identical before posting the values to Craft's controller.


---

### Answer by username_2 on 2016-03-17. Score: 11

If anyone is interested in confirming passwords still, I have wrote a plugin which does just this, it doesn't rely on it's own controller either so there is no bypassing of Crafts own workings :)
https://github.com/alecritson/Craft-Password-Confirm
All you need to do is add a passwordConfirm field to your existing form:

{% if account is defined %}
  {{ account.getErrors('passwordConfirm') }}
{% endif %}

It doesn't confirm emails though..sorry

> **Comments:**
> **username_3**: This is great, and can easily be modified to support confirm email as well!  

---

### Answer by username_4 on 2014-09-11. Score: 4

In addition to [letting JavaScript](https://craftcms.stackexchange.com/a/2483/57) take care of the extra front-end logic, you could also write a [plugin](http://buildwithcraft.com/docs/plugins/introduction) that exposes a [controller](http://buildwithcraft.com/docs/plugins/controllers) that does the extra email and password sameness checks from PHP.

If those are equal, then it would just pass the data off to `craft()->users->saveUser()`, otherwise, return any validation errors back to the template.

> **Comments:**
> **username_0**: Thanks Brad - will bear that in mind for the future if I ever manage to get my head around OO PHP :)  

---

