close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Using Implode in the Email Form

Thread began 11/01/2010 11:08 am by Martin | Last modified 11/01/2010 12:10 pm by Jason Byrnes | 2279 views | 8 replies |

Martin

Using Implode in the Email Form

Greetings, I had a problem with this issue earlier.

showthread.php?t=16194&highlight=implode

I have attempted to follow Jason's instructions (which worked before) but this time it is still not generating anything in the final e-mail to the recipient?

<?php echo((isset($_POST["Appointment_Request_group_Best_Approximate_Time[]"]))?implode(", ",$_POST["Appointment_Request_group_Best_Approximate_Time[]"]):"") ?>

In the CSS form builder it adds the [] at the end, is this maybe what is wrong?

Here is the code from the form...

<label for="Appointment_request_group_Best_Approximate_Time" class="sublabel" >Best Approximate Time?:<span class="requiredIndicator">&nbsp;*</span></label>
<div class="errorGroup">
<div class="fieldPair">
<div class="fieldGroup"> <span id="Appointment_request_group_Best_Approximate_Time_Spry">
<select class="formListfield_Medium" name="Appointment_request_group_Best_Approximate_Time[]" id="Appointment_request_group_Best_Approximate_Time" tabindex="5" multiple="multiple" onblur="hideServerError('Appointment_request_group_Best_Approximate_Time_ServerError');">

Any help would be appreciated!

Thanks,
Martin

Sign in to reply to this post

Jason ByrnesWebAssist

yes, in the echo, you need to remove the "[]", they are only needed in the form elements name, and should be removed from the echo.

Sign in to reply to this post

Martin

Just looking at the code, I have no idea why the separation in the word time is occurring. It does not appear in the code.

Sign in to reply to this post

Martin

Ok, I have removed the [] and tried it again. Still no success in generating multiple times in the final email ...

<?php echo((isset($_POST["Appointment_Request_group_Best_Approximate_Time"]))?implode(", ",$_POST["Appointment_Request_group_Best_Approximate_Time"]):"") ?>

Do I have to remove the [] in the form as well?

Thanks again!

Martin

Sign in to reply to this post

Jason ByrnesWebAssist

please send me the form page and the email page so I can examine the code.

Sign in to reply to this post

Martin

here is the code...

Thanks!

Attached Files
appointment.zip
Sign in to reply to this post

Jason ByrnesWebAssist

the problem is case sensitivity.


the form element name is "Appointment_request_group_Best_Approximate_Time[]"

php:
<select class="formListfield_Medium" name="Appointment_request_group_Best_Approximate_Time[]" id="Appointment_request_group_Best_Approximate_Time" tabindex="5" multiple="multiple" onblur="hideServerError('Appointment_request_group_Best_Approximate_Time_ServerError');">





but in the echo, you are capitalizing the "r" in "request, so it becomes "Appointment_Request_group_Best_Approximate_Time". the code you have is:

php:
<?php echo((isset($_POST["Appointment_Request_group_Best_Approximate_Time"]))?implode(", ",$_POST["Appointment_Request_group_Best_Approximate_Time"]):""?>




but it needs to use a lower case "r" for request:

php:
<?php echo((isset($_POST["Appointment_request_group_Best_Approximate_Time"]))?implode(", ",$_POST["Appointment_request_group_Best_Approximate_Time"]):""?>




PHP is case sensitive.

Sign in to reply to this post

Martin

Excellent - that worked perfectly! Thanks! I did not notice that there was a case issue!

Much appreciated as usual!

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

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