Click to See Complete Forum and Search --> : E-Mail forms


Strat94
11-25-2003, 11:11 AM
Hi guys, here is what I am trying to do...

I have got a web page with a list of people to e-mail (using the a href=mailto code and what I would like to do is put a tick box by everyones name and then click a button to instantly put them all into a a href=mailto link into the default mail program. Also, a mail all tick box. Any ideas??? Its been troubling me for months!!!!

soccer362001
11-25-2003, 02:11 PM
I don't think that is possible for Javascript. You may try PHP..

Strat94
11-26-2003, 06:42 AM
Thats the reply I was dreading. I am frantically trying not to use .asp or .php as my ISP will start charging me a fortune. any other ideas...??

Gollum
11-26-2003, 07:06 AM
Does this do what you want?

<html>
<body>
<form name=f>
<input type=checkbox name=sa onclick="for ( i = 0; i < document.f.chk.length; i++ ) document.f.chk[i].checked = this.checked;">Select All<br>
<input type=checkbox name=chk value="a@mail.com"><a href="mailto:a@mail.com">a@mail.com</a><br>
<input type=checkbox name=chk value="b@mail.com"><a href="mailto:b@mail.com">b@mail.com</a><br>
<input type=checkbox name=chk value="c@mail.com"><a href="mailto:c@mail.com">c@mail.com</a><br>
<br>
<a href="" onclick="var s = new Array; for ( i = 0; i < document.f.chk.length; i++ ) if ( document.f.chk[i].checked ) s.push(document.f.chk[i].value); this.href = 'mailto:' + s.join(';');">Group Mail</a>
</form>
</body>
</html>

Strat94
11-27-2003, 12:06 PM
That looks great, will have a play at the weekend to see it that works within my code...!!!! Thanks..!!!