Add "privacy policy" check box in contact page for GDPR

5 replies·opened May 5, 2018
F
frederic80May 5, 2018

Hello,

Is there an html/php update possible to foresee the contact form with a check box. Customers have to check it in order to agree with the privacy policy of the website.

Thanks to inform me how I can add this to contact form, and the php must be changed so I can see in the mail a customer has checked it or not.

Thanks a lot for your answer in advance.

F
frederic80May 9, 2018

Can anyone help me here?
I found the checkboxes on the page "component-radios-switches.html" of the canvas site. (see attached)
How can I link this with the send button of the canvas contact form?
It's original state of the checkbox is unchecked. If customer has pressed on the "send" button, how can I include the information of the checked or unchecked checkbox in the email?

Thanks in advance!

F
frederic80May 14, 2018

Anyone? Suggestions?

F
frederic80May 15, 2018
<div>
								<input id="checkbox-privacypolicy" class="required checkbox-style" name="checkbox-privacypolicy" type="checkbox">
								<label for="checkbox-privacypolicy" class="checkbox-style-3-label">Ik heb de <a href="privacy-policy.html" title="privacy policy">Privacy policy</a> gelezen en goedgekeurd.<small>*</small> / I have read and accepted the <a href="privacy-policy.html" title="privacy policy">Privacy policy</a> <small>*</small></label>
							</div>

This is the addition I made in the html contact form.
What do I have to do in the PHP file to make it work?

F
frederic80May 29, 2018

Is there a fix / solution in html/php/... code?
Anyone?

S
SemiColonWebSTAFFMay 31, 2018

Hello,

Thanks for your Patience!

The Code you are trying to use in HTML should work fine. Make sure that you simply add a Value to the Input tag:

<input id="checkbox-privacypolicy" class="required checkbox-style" name="checkbox-privacypolicy" value="1" type="checkbox">

For PHP, consider adding the following code just after the if( isset( $_POST['g-recaptcha-response'] ) ) { ... } Block of Code:

if( !isset( $_POST['checkbox-privacypolicy'] ) ) {
	echo '{ "alert": "error", "message": "GDPR not checked." }';
	die;
}

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard
Add "privacy policy" check box in contact page for GDPR · Canvas Template Support