[Javascript] confusing ....

Andreas Krite krite at 3dfactory.de
Tue Mar 27 01:33:20 CST 2001


Hiya,

I'm not really new to this list and hope that someone could help me finding the right way.
I like to build a mail-form where you can choose via drop-down a recipient 1 and a recipient 2 - the example listed below is not working :-(( and I'm not experienced enough to find the error.

Thanks in advance

regards
Andreas
********************************************************************
<FORM NAME="mailer" METHOD="post" ACTION="" ENCTYPE="text/plain" 
onSubmit="(document.mailer.action += mailtoandsubject)"> 
<TABLE BORDER=0>
  <TR VALIGN="top">
 <TD>Recipient 1:</TD>
 <TD><SELECT NAME="mailtoperson" onChange="msg(this.form)">
  <OPTION VALUE="">-- Select --
  <OPTION VALUE="akrite at ginko.de">Ginko
  <OPTION VALUE="akrite at t-online.de"> T-online.de
  <OPTION VALUE="krite at 3dfactory.de">3D factory
     </SELECT>
 </TD>
  </TR>
<TR VALIGN="top">
 <TD>Recipient 2:</TD>
 <TD><SELECT NAME="mailtopersonCC" onChange="msg(this.form)">
  <OPTION VALUE="">-- Select --
  <OPTION VALUE="akrite at ginko.de">Ginko
  <OPTION VALUE="akrite at t-online.de">T-online.de
  <OPTION VALUE="krite at 3dfactory.de">3D factory
     </SELECT>
 </TD>
  <TR VALIGN="top">
 <TD>Subject:</TD>
 <TD><INPUT TYPE="text" SIZE=45 NAME="subject" onChange="msg(this.form)"></TD>
  </TR>
  <TR VALIGN="top">
 <TD>Message:</TD>
 <TD><TEXTAREA NAME="message" COLS=45 ROWS=5 WRAP="virtual" OnChange="msg(this.form)"></TEXTAREA></TD>
  </TR>
  <TR>
 <TD> </TD>
 <TD><INPUT TYPE="submit" VALUE="Send Message">
 <INPUT TYPE="reset" VALUE="Reset"></TD>
  </TR>
</TABLE>
</FORM>

<SCRIPT LANGUAGE="JavaScript">
function msg() {
document.mailer.action = "mailto:" 
mailtoandsubject = ((document.mailer.mailtoperson.options[document.mailer.mailtoperson.selectedIndex].value)
 + '&CC=' + (document.mailer.mailtopersonCC.options[document.mailer.mailtopersonCC.selectedIndex].value)
 + '&BCC=email at email.de' 
 + '?subject=' + document.mailer.subject.value); 
} 
</SCRIPT> 
************************************************************************************************************





More information about the Javascript mailing list