Mailcode
Multiple check boxes - only one in email
| User | Post |
|---|---|
|
Artisan Member Posts: 6 |
Posted: 2010-02-06 08:49:41
|
| Hi Scott I have 5 checkboxes on a form I've created at http://006.artinet.co.uk/free-articles/biz-bits.php (temporary url), which works fine, but when I receive the email, only one of the checkbox options is shown, regardless of how many are ticked when filling out the form. This is how the form result should be: Quote: PDF downloads: The Buyers Stone Walls, Dealing with Objections, What makes a successful salesperson, Marketing and Selling in Difficult economic times, Preparing the sales plan ... and this is how it appears: Quote: PDF downloads: The Buyers Stone Walls (not necessarily the first in the list, it seems to display them at random).I've tested the checkbox code in an existing form (which uses FormMail) and all the checkbox items selected show on the email, so I know my code is OK, but only one shows in the email from my MailCode form. I made sure that no non-alphanumeric characters are being used in the form code or in the subject line in config.php (I've made that mistake before!). Have you used checkboxes in a form successfully? Any ideas? Malcolm |
|
|
Scott Admin Posts: 211 |
Posted: 2010-02-06 15:31:56
|
| Malcolm, Thanks for mentioning this. I wasn't aware that checkboxes weren't grouping. I'll work on a solution and update the script. |
|
|
Scott Admin Posts: 211 |
Posted: 2010-02-06 18:32:53
|
| Mailcode v.1.94 has been released to address this issue. To utilize the grouping function, you must name your form fields as arrays. For example, if you want to name your group checkbox, you would append brackets to the end of the group name as follows: Code: <input type="checkbox" name="checkbox[]" value="checkbox 1" /> <input type="checkbox" name="checkbox[]" value="checkbox 2" /> <input type="checkbox" name="checkbox[]" value="checkbox 3" /> <input type="checkbox" name="checkbox[]" value="checkbox 4" /> <input type="checkbox" name="checkbox[]" value="checkbox 5" /> |
|
|
Artisan Member Posts: 6 |
Posted: 2010-02-11 09:44:18
|
| Hi Scott Thanks for that, although all I'm getting in the email now is PDF_downloads: Array. Here's my code: Code: <input type="checkbox" name="PDF downloads[]" value="The Buyers Stone Walls"> <input type="checkbox" name="PDF downloads[]" value="Dealing with Objections"> <input type="checkbox" name="PDF downloads[]" value="What makes a successful salesperson"> <input type="checkbox" name="PDF downloads[]" value="Marketing and Selling in Difficult economic times"> <input type="checkbox" name="PDF downloads[]" value="Preparing the sales plan"> Would it be easier for me to download Mailcode v.1.94 and use that instead? Malcolm |
|
|
Scott Admin Posts: 211 |
Posted: 2010-02-11 09:51:26
|
| Yes, you will have to download the latest version to use the grouping function. | |
|
Artisan Member Posts: 6 |
Posted: 2010-02-11 10:15:58
|
| Thanks Scott |
Page:
[ 1 ]
New Post
You must be logged in to post on the discussion boards.





