Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-10-2012, 03:03 PM   PM User | #1
jpcsolutions
New to the CF scene

 
Join Date: Nov 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
jpcsolutions is an unknown quantity at this point
Javascript Email Project

I'm trying to implement a javascript program into an html environment. I'm having trouble trying to figure out how to write the program.

Essentially, I want to have a bunch of document icons on a page. There would be a checkbox next to each document. Check all the appropriate documents one wants to send to someone. Click "Generate Email" and an Outlook (or default mailer) email would be created with said documents attached.

Please note that this site will be maintained on an Intranet, and won't be public. Only employees will have access to it.



Any ideas where I can start?

-Jared
(JPC Solutions)
jpcsolutions is offline   Reply With Quote
Old 11-10-2012, 09:19 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,033
Thanks: 197
Thanked 2,410 Times in 2,388 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
This forum is not a free coding service. As a general rule, the people helping out in this forum don't write code for others, but try to help with fixing code that doesn't work. You may perhaps get someone to write this script for you, but you'll be far more likely to get help if you have made a substantial effort and written some code yourself. Then someone here will almost certainly help you correct/improve your work.

You seem to be contemplating using the long-obsolete mailto:. Modern browsers no longer accept mailto: as a form action - they simply open the email program (if any) and ignore the form. If you are going to use a form then use a server-side CGI formmail script as the action - there are several good free ones out there.

Be aware that mailto: does not provide any way to include an attachment.


It is your responsibility to die() if necessary….. - PHP Manual
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Philip M is offline   Reply With Quote
Old 11-10-2012, 10:09 PM   PM User | #3
minder
Banned

 
Join Date: Oct 2012
Posts: 81
Thanks: 0
Thanked 4 Times in 4 Posts
minder can only hope to improve
Quote:
Originally Posted by jpcsolutions View Post

Any ideas where I can start?
I'm guessing you're not actually looking for someone to write the code for you, so here are a few tips on how you can go about starting your project.

1. Markup the html to display the image icons, checkboxes and button in a form.

2. Each document should have a unique id value, if the docs are retrieved from a database, which should be set to the value of the doc's checkbox.

3. If the doc's meta data is not stored in a database you can use the doc's file name as the checkbox value.

4. Give all the doc checkboxes the same name so that the selected id's or file names can be sent as an array of values to a server side script (PHP can send email attachments very easily) that will send out the email with attachments.

5. The server side script will loop through the array of doc values sent to it, append all the attachments to an email and then send it out. If you will be using php then all of the above can be done in 2-3 hours max from go to whoa for someone who knows html, css and php. You don't need javascript at all for your project unless you want to do some optional client side data validation.

6. All validation must be done server side using php or your preferred server side language.

Last edited by minder; 11-10-2012 at 10:14 PM..
minder is offline   Reply With Quote
Reply

Bookmarks

Tags
checkbox, checkmark, email, javascript

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:22 PM.


Advertisement
Log in to turn off these ads.