Copy link to clipboard
Copied
Hi
i have one little problem the grade or interest and specialties should be able to select multiple options and i have set this up but when i test it the information coming back on email shows only only on selection for these fields. Anyone know why. http://www.locumexpress.ie/online%20reg.php
Thanks
Natasha
When form fields allow multiple choices, the form must submit them as an array. To do this, add an empty pair of square brackets after the name attribute.
The name attribute of form elements should not contain any spaces, so this is invalid:
<select name="Grade of Interest"
You should replace it with something like this:
<select name="Grade_of_interest[]"
This submits the values as an array, so you need to use implode() to convert them back to a string:
...if (isset($_POST['Grade_of_interest'])) {
$
Copy link to clipboard
Copied
Please post PHP-related questions in the correct forum: Dreamweaver Application Development, where your thread has been moved.
Copy link to clipboard
Copied
When form fields allow multiple choices, the form must submit them as an array. To do this, add an empty pair of square brackets after the name attribute.
The name attribute of form elements should not contain any spaces, so this is invalid:
<select name="Grade of Interest"
You should replace it with something like this:
<select name="Grade_of_interest[]"
This submits the values as an array, so you need to use implode() to convert them back to a string:
if (isset($_POST['Grade_of_interest'])) {
$_POST['Grade_of_interest'] = implode(', ', $_POST['Grade_of_interest'])
}
I also notice that you're using spaces in your file names. You should never put spaces in file or folder names on a website. The reason it's working now is because your site is hosted on a Windows server. If the site is ever moved to a Linux server (and most sites are hosted on Linux), it will break. Also, the %20 that represents the space in the middle of the URL looks ugly.
Copy link to clipboard
Copied
Thanks for that
Find more inspiration, events, and resources on the new Adobe Community
Explore Now