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?
CGBetterForms enter email address twice for validation
-
- 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
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}
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.
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.
Re: CGBetterForms enter email address twice for validation
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?
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?
-
- 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
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.
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.
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.
Re: CGBetterForms enter email address twice for validation
Great, thanks for your help and work on CGBetterForms, it's maturing nicely.