close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Adding Google reCaptcha to Data bridge page

Thread began 2/01/2018 7:47 am by iain331081 | Last modified 2/07/2018 7:50 pm by Ray Borduin | 2253 views | 8 replies |

iain331081

Adding Google reCaptcha to Data bridge page

I am just looking at adding the Google reCaptcha to a WA based page. But I'm not sure about the position of where to put the various bits of PHP for doing the insert and sending email notifications as well when the form is submitted.

I have attached a page that had the reCaptcha working - but in its current state it displays success or fail messages correctly, but at the top of the page. Ideally they would be down the page at line 370 next to the reCaptcha graphic.

And it needs to do the insert and trigger the emails if the reCaptcha validates. I think its hopefully just a case of moving a couple of bits around, or putting some of the WA code inside the 'else' part of the reCaptcha code at the top. I've had a go, but couldn't seem to get it.

Thanks for having a look.

Sign in to reply to this post

iain331081

OK - think I've made a bit of progress. I have put the insert and email code inside the ELSE statement for the reCaptcha.

I have it working now so that it shows the the fail message at the top of the page if the reCaptcha isn't validated. Can you have a look at check its done as it should be? I know sometimes things might work, but might not be done as they should.

And when it is validated it is inserting the new record, and triggering the two emails correctly.

The only thing I'm not sure is how to have the error message appear down at line 384?

Also, can you remind me of how to keep the form contents in the input boxed persist if the reCaptcha fails, so that people don't have to fill in the form again?

Sign in to reply to this post

iain331081

I have another variation, with all of the relevant code moved down to the <div> where the captcha fail message should appear.

This one displays the message in the correct place, inserts the record, and triggers the two emails.

But isn't redirecting to the thanks page....

So I have two that are nearly there but not quite....

Sign in to reply to this post

Ray BorduinWebAssist

The code is in the wrong spot.

1) Move all of the code above the: <!doctype html>

2) replace this code:

if(intval($responseKeys["success"]) !== 1) {
echo '<br><h5>Please check the captcha</h5>';
} else {



with this:

if(intval($responseKeys["success"]) === 1) {



Then use this in the div where you want the message to appear:

php:
<?php

                    
if(isset($_POST["Registration_submit"])){        
                            echo 
'<br><h5>Please check the captcha</h5>';
          }
?>
Sign in to reply to this post
Did this help? Tips are appreciated...

iain331081

Thanks Ray. That has sorted the reCaptcha, but its submitting without the required fields being entered.

Sign in to reply to this post

Ray BorduinWebAssist

It doesn't look like there is any validation on those fields. Open the WA Server Validations server behavior from the server behaviors window and you should be able to add the other validations back in.

Sign in to reply to this post
Did this help? Tips are appreciated...

iain331081

Thanks Ray - my serial number is being rejected on my laptop as its had two activations already. I've changed computers over time, but do only have my desktop and laptop now.

Sign in to reply to this post

Ray BorduinWebAssist

You can click the "Clear Activations" button on the "All My Downloads" page linked from your account to activate on a new computer.

Sign in to reply to this post
Did this help? Tips are appreciated...

iain331081

Ah, OK - thanks Ray. I got it working with the jquery / Bloom validation, rather than the server validations.

I'm away now so can't double check, but I'm sure it was working on my desktop, but wasn't on my laptop. But the code in the PM below was missing. I added that and it worked again, with the Bloom styling and positioning. (It had been working without it I'm sure, just with the default position and style of the validation message.)

Not sure why, but don't suppose it matters now that it seems OK.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...