Home › Forums › Invisible reCaptcha › How-To and Troubleshooting › Inserting the code into a custom form – help! :)
- This topic has 4 replies, 5 voices, and was last updated 3 years, 1 month ago by
Anonymous.
-
AuthorPosts
-
June 1, 2017 at 4:46 am #4514
Ann MakiParticipantI’m a complete newbie to the invisible recaptcha plugin and was hoping someone could help me add it to a custom form.
I saw the documentation on adding it to those, but am having a hard time figuring it out :/
Here is the code to my form (it’s in my header):
<div id=”action_box” data-arrowpos=”center” style=”margin-top:-3px”>
<div class=”container”>
<div class=”row”><div class=”span12″><h4 class=”text”><center><span class=”subtitle” style=”color:white;text-align:center;float:left;”>Sign Up For A FREE<br> $10 Open Bowling Certificate! </span></center><center>
<form action=”/apixml.php” method=”GET”>
<input type=”hidden” name=”account_id” value=”<?php the_field(‘account_id’, ‘option’); ?>”>
<input type=”hidden” name=”audience_id” value=”<?php the_field(‘audience_id’, ‘option’); ?>”>
<input type=”hidden” name=”list_id” value=”<?php the_field(‘list_id’, ‘option’); ?>”>
<input type=”text” id=”Input1″ name=”first_name” placeholder=”First Name” style=”color:#595959;font-family: Lato, ‘Helvetica Neue’, Helvetica, Arial, sans-serif;margin-top: 10px;margin-right: 20px;padding: 10px;”>
<input type=”text” id=”Input2″ name=”email” placeholder=”Email Address” style=”margin-bottom: 10px;
margin-right: 20px; margin-top:10px;padding: 10px;color:#595959;font-family: Lato, ‘Helvetica Neue’, Helvetica, Arial, sans-serif;”>
<button style=”font-size:18px;padding: 12px 25px;” class=”btn-primary btn”>Send My Certificate!</button></form></center></h4></div>
</div>
</div>
</div>Can anyone tell where what to put where in order to get it to work?
Also, where would I find my site key and secret key? Sorry if this is all easy and i’m just missing things!!
June 4, 2017 at 10:43 pm #4515
MihCheKeymasterHi Ann,
Just insert
<?php do_action(‘google_invre_render_widget_action’); ?>
before</form>
Change your form method type from GET to POST
This<form action=”/apixml.php” method=”GET”>
should be<form action=”/apixml.php” method=”POST”>
On the server side, where the form is validated just add
$is_valid = apply_filters(‘google_invre_is_valid_request_filter’, true); if( ! $is_valid ) { // handle error here } else { // continue with your logic }
~Mihai
November 6, 2017 at 11:23 am #4727
Adam TeslukParticipantHey MihChe,
Wondeful plugin! I actually have a similar problem.
Wordpress comments out php within post content via the front end. <?php do_action(‘google_invre_render_widget_action’); ?>
ends up being rendered as…
<!– ?php do_action(‘google_invre_render_widget_action’); ? –>
My question, is there a way around this in custom content for wordpress pages, aside from using a custom shortcode?
January 25, 2018 at 12:59 am #4794
AnonymousInactiveThanks for the snippets !
February 2, 2018 at 6:23 am #4808
AnonymousInactiveThis reply has been marked as private. -
AuthorPosts
You must be logged in to reply to this topic.