Jump to content

How to make users re-type email address on register/cart to confirm correct email?


paperweight

Recommended Posts

Is there a good method in the templates to require users to re-type their email address for confirmation when registering (register.php) and when checking out (cart.php)? For example, WHMCS has a nice way of confirming the password is correct by re-typing it, but how do I do the same thing on email address to make sure users type correct email address?

Link to comment
Share on other sites

Thanks for your comments. I like the API idea but it creates some other problems in the way I have things setup.

 

The Javascript idea is great and I used the info here: http://stackoverflow.com/questions/18223467/email-match-with-confirm-email-address-in-contact-form

 

However, the problem with that code, is the user gets an error message but once they click "ok" on the message, they are allowed to continue without editing and correcting their mistake. What do you suggest I add to the Javascript to ensure both email addresses must match before going through with the form?

 

It does appear that php would be the best way to validate the form though. What kind of error did you have when you tried php?

Link to comment
Share on other sites

This is a tricky question.

 

Yes, you should validate fields with PHP (server side). In fact if you just use javascript to validate them, users can still skip all your checks by simply disabling javascript on their browsers. So the rule is: server side validation plus (optional) javascript one so that it looks better and works without refreshing any page.

 

You could validate fields with PHP with this hook point but only when an user has been already registered. If you find that there's something wrong you could probably close his account so that he can't do anything and redirect him to Modify Details page where he needs to update his personal details according to your rules. This server side validation is trigged only if users have turned off javascript.

 

Anyway again in my opinion the best approach is API since you can't a clean job only editing .tpl file.

Link to comment
Share on other sites

This is a tricky question.

....

Anyway again in my opinion the best approach is API since you can't a clean job only editing .tpl file.

 

Yes I agree. I looked at your fantastic API creation page and I see API is a good idea. However, I need to also include this on the cart.php. The register.php seems easy and straightforward, but messing with cart (and I have multiple languages) seems like a painful experience since there seems so many items to worry about, such as discount codes, payment gateways, etc.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated