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

form failing validation

Thread began 4/14/2021 11:58 am by MagsW | Last modified 4/16/2021 10:15 am by Ray Borduin | 78 views | 6 replies |

MagsW

form failing validation

Hi Ray, I'm having a problem with the attached page, when I submit the form with all fields completed all the server validations are failing. I have a similar form on the same site which works fine, have checked to make sure the code blocks are in the correct order but can't see what the problem might be. Would you mind taking a look for me?

Sign in to reply to this post

Ray BorduinWebAssist

Does it give an error message associated with the failed validation? Having a form element with the name "Name" is a potential problem, but I'm not sure if that is it. I can't spot anything else though. Can you give more details on what you see that makes you think it failed the server validation?

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

MagsW

All my Validation Show If fields appear, the form doesn't redirect to the success message and I don't receive an email. I've added a link to page in the PM so you can try it.

Sign in to reply to this post

Ray BorduinWebAssist

That is the clue I needed to figure it out. The validation is using $_GET to refer to the form elements, but the form has method="post"

I think if you update that $_GET references on the page to $_POST, that should fix the problem.

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

MagsW

Yes, that sorted it! Only issue I've found now is that the select list is set to allow the user to select multiple options, but on the email only one option is recorded. How can I get it include all the selected options in the email? Copy of email is attached.

Sign in to reply to this post

Ray BorduinWebAssist

In order to allow multi-select with php you have to name the form element with brackets. So instead of name="event", it needs to be name="event[]".

That will submit the events selected as an array instead of a text value.

Now that you have an array, you can bind it. Our form bindings should allow you to add it to the page comma-separated. To do it manually, you can chage:

php:
<?php echo((isset($_POST["event"]))?$_POST["event"]:""?>

to:

php:
<?php echo((isset($_POST["event"]))?implode(", ",$_POST["event"]):""?>
Sign in to reply to this post
Did this help? Tips are appreciated...

MagsW

Great thanks, it's working now!

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