close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Adding a captcha widget to a form in a modal

Thread began 3/31/2021 9:37 am by MagsW | Last modified 4/02/2021 8:58 am by Ray Borduin | 35 views | 10 replies |

MagsW

Adding a captcha widget to a form in a modal

Hi Ray, I wonder if you could take a look at the attached page? I have a booking form in a modal window which I've just added a captcha to. The other fields all have server validation applied as well. However, I've only just noticed that none of the validation is actually working properly - you hit the submit button and if the fields are correctly completed the form submits, the email sends and you're redirected to the success message, but if the fields aren't correctly completed the modal window still closes and no message is shown so the user doesn't know the form hasn't submitted. I thought it was just because the form is in a modal but even if you re-open the window, none of the validation show if fields are showing. I've been trying for hours to get this to work properly with no success! The ideal scenario would be for the modal window not to close when the button is pressed.

Sign in to reply to this post

simon167250

Add a failed validation message to the page so the user will know it failed.

Sign in to reply to this post

MagsW

I tried adding a generic failed validation message to the main page but it's not displaying either - the validation does prevent the form from submitting but none of the failed validation messages are showing whether they're beside the form fields in the modal or back on the main page. No idea what's going on - I use this all the time but for some reason on this page it just won't work.

Sign in to reply to this post

simon167250

This post has been deleted.

MagsW

This post has been deleted.

Ray BorduinWebAssist

Sorry about that... that was actually me, but I had logged in as a user to check something in his account and forgot to log out. Smart move not to share any FTP information with anyone else. However, if you could give it to me in the private area I can help debug it.

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

MagsW

Phew, that's a relief!! Thanks for confirming, details in PM!

Sign in to reply to this post

Ray BorduinWebAssist

Your error message was in a section of the page that only is displayed when the url parameter "book" is set.

To fix the problem, I added the url parameter and an anchor to the server validation failed redirect. I also added an action to the form to clear the parameter when the form is re-submitted.

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

MagsW

Hi Ray

There still seems to be a couple of issues with it - if I submit the form without filling anything in, it still closes the modal and none of the server validation messages appear. Also, the success message displays underneath the error message as they're both in the same area. The ideal scenario would be if someone doesn't fill in one or all of the fields, the modal stays open and the individual error messages are shown, particularly the captcha field.

Sign in to reply to this post

Ray BorduinWebAssist

You could probably use javascript in the show if area to re-open the modal if it fails validation.

Keeping the modal open is more difficult. It would mean doing validation through AJAX, and would require more hand coding. I could help with that in a premier support ticket.

The success message can be wrapped in a server validation show if region to only show if all validations pass. That is the easier solution.

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

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...