• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: CGBetterForms enter email address twice for validation
PostPosted: Sun Nov 25, 2018 1:47 pm 
Offline
Forum Members
Forum Members

Joined: Tue Sep 08, 2015 10:41 am
Posts: 124
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?


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: CGBetterForms enter email address twice for validation  Topic is solved
PostPosted: Sun Nov 25, 2018 2:05 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 8172
Location: Fernie British Columbia, Canada
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.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: CGBetterForms enter email address twice for validation
PostPosted: Sun Nov 25, 2018 2:17 pm 
Offline
Forum Members
Forum Members

Joined: Tue Sep 08, 2015 10:41 am
Posts: 124
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?


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: CGBetterForms enter email address twice for validation
PostPosted: Sun Nov 25, 2018 8:20 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 8172
Location: Fernie British Columbia, Canada
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.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: CGBetterForms enter email address twice for validation
PostPosted: Mon Nov 26, 2018 12:42 am 
Offline
Forum Members
Forum Members

Joined: Tue Sep 08, 2015 10:41 am
Posts: 124
Great, thanks for your help and work on CGBetterForms, it's maturing nicely.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: velden


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Hosting Nation - Managed CMSMS Hosting