Connecting Tech Pros Worldwide Forums | Help | Site Map

Check Boxes communicating with Buttons

Newbie
 
Join Date: Jun 2007
Posts: 8
#1: Aug 28 '08
hey all, i'm trying to make an employee directory in a Table with check boxes beside each employees email address. What i want it to do is at the bottom of the directory i want a Button to compile all of the checked check boxes and enter those email addresses in a new email document using a mailto command.

Any ideas? I'm sure i have seen something similar done before. I would prefer to keep it in HTML if possible as i am a very junior programmer.

Thanks for any help,

burG

Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,656
#2: Aug 29 '08

re: Check Boxes communicating with Buttons


I think that's not possible without the help of a script language. Since HTML is about markup it can't read out the checkbox status. And the button essentially triggers a form to be executed (which is processed by a script language)
The two possibilities I see is
- use javascript to feed the mailto with values
- use a sever side script to send the email (php, asp, perl...)
Newbie
 
Join Date: Aug 2008
Posts: 6
#3: Aug 29 '08

re: Check Boxes communicating with Buttons


Just HTML, and just a mailto: action? Then just like this:

Expand|Select|Wrap|Line Numbers
  1. <form action="mailto:youremail@someplace.com" enctype="text/plain" method="post">
  2.  
  3. <label for="Email@mail.com">Email1@mail.com</label><input type="checkbox" name="Email@mail.com" /><br />
  4. <label for="Email2@mail.com">Email2@mail.com</label><input type="checkbox" name="Email2@mail.com" /><br />
  5. <label for="Email3@mail.com">Email3@mail.com</label><input type="checkbox" name="Email3@mail.com" /><br>
  6. <input type="submit" />
  7.  
  8. </form>
  9.  
It will open the users email program and only list the items that were checked.

This will be valid in transitional style, but not in strict.

I really recommend that you don't do it this way, mailto: is a nasty action. You also would might want to learn at least some basic JavaScript to ensure people can't send it blank.
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,656
#4: Aug 29 '08

re: Check Boxes communicating with Buttons


Quote:

Originally Posted by SAF22

Just HTML, and just a mailto: action? Then just like this

never heard of that way, at least it's good to know. though I would always use a script to send mails
Reply


Similar HTML / CSS bytes