<![CDATA[ FormIt - Recaptchav2 validation problem with form - My Forums]]> https://forums.modx.com/thread/?thread=102751 <![CDATA[FormIt - Recaptchav2 validation problem with form]]> https://forums.modx.com/thread/102751/formit---recaptchav2-validation-problem-with-form?page=3#dis-post-553427
I have a form which is using recaptchav2. The keys for recaptcha are configured in system settings. If I fill out all the fields without checking the recaptcha checkbox and press submit button, it gives me error on the form, that recaptcha was not checked. If I check the recaptcha and press the submit button, the situation is the same, at both situations I don't get an email. If I remove the hook recaptcha or place it before redirect hook, the emails are sent to me and saved in CMS.

So I want that my form requires all the fields and checking the recaptcha to make the form working. I'm not sure what is wrong in the code?

Are there any new ways of changing theme to dark besides this solution: https://forums.modx.com/thread/99538/recaptcha-v2-how-to-change-it-s-theme ?

[[!FormIt?
&hooks=`recaptchav2, spam, email, FormItSaveForm, FormItAutoResponder, redirect`
&recaptchaTheme=`dark`
&formName=`NameOfForm`
&emailTpl=`quoteFormEmailTmpl`
&emailTo=`[email protected]`
&emailSubject=`Subject`
&fiarTpl=`quoteFormEmailRspTempl`
&fiarSubject=`Subject`
&fiarReplyTo=`[email protected]`
&validate=`nospam:blank,
name:required,
email:email:required,
place_dep:required,
place_arr:required,
date_dep:required`
&redirectTo=`5`
]]
[[!+fi.validation_error_message:notempty=`<p>[[!+fi.validation_error_message]]</p>`]]
<form action="[[~[[*id]]]]" method="post">
<input type="hidden" name="nospam" value="" />
<div class="form_wrap">
<div class="field">
<label>Name</label>
<input class="solid" type="text" name="name" required="" value="[[!+fi.name]]">


</div> <span class="error">[[!+fi.error.name]]</span>
<div class="field">
<label>e-mail</label>
<input class="solid" type="email" id="email" class="floatLabel" name="email" value="[[!+fi.email]]">


</div> <span class="error">[[!+fi.error.email]]</span>
<div class="field">
<label>Location 1</label>
<input class="solid" id="searchTextField" type="text" name="place_dep" placeholder="" value="[[!+fi.place_dep]]">
</div> <span class="error">[[!+fi.error.place_dep]]</span>
<div class="field">
<label>Location 2</label>
<input class="solid" id="searchTextField2" type="text" name="place_arr" placeholder="" value="[[!+fi.place_arr]]">


</div> <span class="error">[[!+fi.error.place_arr]]</span>
<div class="field">
<label>Arrival</label>
<input class="solid" id="datepicker" name="date_dep" value="[[!+fi.date_dep]]">


</div> <span class="error">[[!+fi.error.date_dep]]</span>
<div class="field back_date">
<label>Departure</label>
<input class="solid" id="datepicker2" name="date_arr" value="[[!+fi.date_arr]]">


</div> <span class="error">[[!+fi.error.date_arr]]</span>
<div class="checkbox_form"> <span>Add return date</span>
<div class="checkboxFour">
<input type="checkbox" value="1" id="checkboxFourInput" />
<label for="checkboxFourInput"></label>
</div>
</div>
<textarea placeholder="Comment..." name="query" value="[[!+fi.query]]"></textarea>


<div class="space_btw" style="margin-top:20px;"></div>
[[!recaptchav2_render]]
<span class="error">[[!+fi.error.recaptchav2_error]]</span>
<input type="submit" value="SEND">
</div>
</form>]]>
unforgiven666 Aug 30, 2017, 09:41 AM https://forums.modx.com/thread/102751/formit---recaptchav2-validation-problem-with-form?page=3#dis-post-553427
<![CDATA[Re: FormIt - Recaptchav2 validation problem with form]]> https://forums.modx.com/thread/102751/formit---recaptchav2-validation-problem-with-form?page=2#dis-post-553529 unforgiven666 Sep 01, 2017, 01:09 PM https://forums.modx.com/thread/102751/formit---recaptchav2-validation-problem-with-form?page=2#dis-post-553529 <![CDATA[Re: FormIt - Recaptchav2 validation problem with form]]> https://forums.modx.com/thread/102751/formit---recaptchav2-validation-problem-with-form?page=2#dis-post-553528 Quote from: lkfranklin at Sep 01, 2017, 11:18 AM
It might be worth creating a new topic for that query as this one is now marked as answered so people who check for support questions may not see this. Also it helps future users with the same issue.
I just don't want to open new discussions and spam everywhere...

Quote from: andytough at Sep 01, 2017, 12:43 PM
You may have to set gmail to allow 'connections from less secure apps'.

https://support.google.com/accounts/answer/6010255?hl=en

Although I see this is not possible if you have two factor authentication enabled for the the gmail account.

This option was already enabled, because the mails are sent on localhost, just not on live server, currently I'm in contact with host provider, maybe there are some firewall settings not allowing smtp go through... I'll report.

]]>
unforgiven666 Sep 01, 2017, 12:51 PM https://forums.modx.com/thread/102751/formit---recaptchav2-validation-problem-with-form?page=2#dis-post-553528
<![CDATA[Re: FormIt - Recaptchav2 validation problem with form]]> https://forums.modx.com/thread/102751/formit---recaptchav2-validation-problem-with-form?page=2#dis-post-553527
https://support.google.com/accounts/answer/6010255?hl=en

Although I see this is not possible if you have two factor authentication enabled for the the gmail account.]]>
andytough Sep 01, 2017, 12:43 PM https://forums.modx.com/thread/102751/formit---recaptchav2-validation-problem-with-form?page=2#dis-post-553527
<![CDATA[Re: FormIt - Recaptchav2 validation problem with form (Best Answer)]]> https://forums.modx.com/thread/102751/formit---recaptchav2-validation-problem-with-form?page=2#dis-post-553526 ]]> lkfranklin Sep 01, 2017, 11:18 AM https://forums.modx.com/thread/102751/formit---recaptchav2-validation-problem-with-form?page=2#dis-post-553526 <![CDATA[Re: FormIt - Recaptchav2 validation problem with form (Best Answer)]]> https://forums.modx.com/thread/102751/formit---recaptchav2-validation-problem-with-form?page=2#dis-post-553525 Today I have set my smtp settings for gmail in system settings and guess what, mails are not sending due to error. But on localhost it is working. So i have checked different topics regarding that, it usually helps if you add a hook '&emailFrom' so I have added this, it is not working. Also i have installed QuickEmail package for better diagnosis. I have tried changing the tls/ssl 587/465 options

I get this error:

2017-09-01 11:11:12 SMTP ERROR: Failed to connect to server: Connection refused (111)
]]>
unforgiven666 Sep 01, 2017, 11:14 AM https://forums.modx.com/thread/102751/formit---recaptchav2-validation-problem-with-form?page=2#dis-post-553525
<![CDATA[Re: FormIt - Recaptchav2 validation problem with form]]> https://forums.modx.com/thread/102751/formit---recaptchav2-validation-problem-with-form?page=2#dis-post-553519 Quote from: lkfranklin at Sep 01, 2017, 06:56 AM
Additionally I believe you also need to access localhost via 127.0.0.1 rather than 'localhost'
I have tried both options before, none of it was working :/]]>
unforgiven666 Sep 01, 2017, 08:43 AM https://forums.modx.com/thread/102751/formit---recaptchav2-validation-problem-with-form?page=2#dis-post-553519
<![CDATA[Re: FormIt - Recaptchav2 validation problem with form]]> https://forums.modx.com/thread/102751/formit---recaptchav2-validation-problem-with-form?page=2#dis-post-553517 lkfranklin Sep 01, 2017, 06:56 AM https://forums.modx.com/thread/102751/formit---recaptchav2-validation-problem-with-form?page=2#dis-post-553517 <![CDATA[Re: FormIt - Recaptchav2 validation problem with form]]> https://forums.modx.com/thread/102751/formit---recaptchav2-validation-problem-with-form?page=2#dis-post-553516
localhost domains are no longer supported by default. If you wish to continue supporting them for development you can add them to the list of supported domains for your site key. Go to the admin console to update your list of supported domains. We advise to use a separate key for development and production and to not allow localhost on your production site key.
]]>
lkfranklin Sep 01, 2017, 06:54 AM https://forums.modx.com/thread/102751/formit---recaptchav2-validation-problem-with-form?page=2#dis-post-553516
<![CDATA[Re: FormIt - Recaptchav2 validation problem with form]]> https://forums.modx.com/thread/102751/formit---recaptchav2-validation-problem-with-form?page=2#dis-post-553513 BobRay Aug 31, 2017, 10:49 PM https://forums.modx.com/thread/102751/formit---recaptchav2-validation-problem-with-form?page=2#dis-post-553513