CGBetterForms enter email address twice for validation

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
JamesT
Forum Members
Forum Members
Posts: 175
Joined: Tue Sep 08, 2015 10:41 am

CGBetterForms enter email address twice for validation

Post by JamesT »

In CGBetterForms I would like the user to enter their email address twice and only submit the form if the two email addresses are identical.

Is this possible?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: CGBetterForms enter email address twice for validation

Post by calguy1000 »

In your form template create the two email forms. and make them look pretty using CSS etc.

In CGBF, scan the form, then add a 'Validate via Smarty template' handler
in that template.

That template would look something like:

{if $email1 != $email2}Please ensure the email address in both fields match{/if}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
JamesT
Forum Members
Forum Members
Posts: 175
Joined: Tue Sep 08, 2015 10:41 am

Re: CGBetterForms enter email address twice for validation

Post by JamesT »

Perfect, many thanks!

If I may be cheeky, can I repeat an earlier post and ask if there's any way to add a checkbox to the form which allows the person submitting the form to choose whether to get emailed a copy?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: CGBetterForms enter email address twice for validation

Post by calguy1000 »

1. Add a hidden field to your form , call it something like 'sendtoaddr'

2. Add a 'compute a field value' validation, set the computed field to 'sendtoaddr'
and set the template to something like:
{if $sendmeacopy}{$myemail}{/if}

3. Use the 'Send to User supplied email address' (or whatever it is called) disposition, and specify the 'sendtoaddr' field.

This will be slightly easier in the next version (v1.9) when I release it.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
JamesT
Forum Members
Forum Members
Posts: 175
Joined: Tue Sep 08, 2015 10:41 am

Re: CGBetterForms enter email address twice for validation

Post by JamesT »

Great, thanks for your help and work on CGBetterForms, it's maturing nicely.
Locked

Return to “Modules/Add-Ons”