Hi there.
I can't seem to work out what I'm doing wrong here and I was wondering if you could help.
I have a form to submit a question, but as the questions vary in nature, I want them to go to 3 or more e-mail addresses. I'm using a drop down menu to select the type of question the user wants to ask then using this to determine what e-mail address to pick.
The cgi on the server is configured to only send an e-mail if the "mailto" field is filled, which is the problem as something's going wrong!
Here's the code:
[HTML]<script language="javascript">
function check_email(){
if (document.makingContact.enquiry.value = "general"){
document.makingContact.mailto.value="email1@liv.ac .uk"
}
if (document.makingContact.enquiry.value = "feedback"){
document.makingContact.mailto.value="email2@liv.ac .uk"
}
if (document.makingContact.enquiry.value = "student"){
document.makingContact.mailto.value="email3@liv.ac .uk"
}
}
</script>
<FORM name=makingContact action="http://www.liv.ac.uk/cgi-bin/mailcomments.cgi" method="post">
<input name="mailto" type="hidden" value="">
<input name="subject" type="hidden" value="Web Enquiry">
<input name="required" type="hidden" value="email">
<input name="response" type="hidden" value="<H2>Submission Sucessful!</H2><br><P>Thank you for your submission</P>" id="">
<TABLE class=tableborderzero style="WIDTH: 512px; HEIGHT: 256px" cellSpacing=2 cellPadding=2 align=left summary="" border=0 cmid="GalleryPage:Copy">
<TBODY>
<TR cmid="GalleryPage:Copy">
<TD cmid="GalleryPage:Copy"><STRONG cmid="GalleryPage:Copy">Enquiry Type</STRONG></TD>
<TD colSpan=3 cmid="GalleryPage:Copy"><SELECT id=enquiry name=enquiry onMouseClick="check_email()"> <OPTION value="general"
>General Enquiry</OPTION> <OPTION value="feedback">Leave
Feedback</OPTION> <OPTION value="student">Student Information</OPTION></SELECT></TD></TR>
<TR cmid="GalleryPage:Copy">
<TD class=tableborderzero cmid="GalleryPage:Copy"><STRONG cmid="GalleryPage:Copy">Forename</STRONG></TD>
<TD colSpan=3 cmid="GalleryPage:Copy"><INPUT id=forename value=forename name=forename></TD></TR>
<TR cmid="GalleryPage:Copy">
<TD class=tableborderzero cmid="GalleryPage:Copy"><STRONG cmid="GalleryPage:Copy">Surname</STRONG></TD>
<TD colSpan=3 cmid="GalleryPage:Copy"><INPUT id=surname value=surname name=surname></TD></TR>
<TR cmid="GalleryPage:Copy">
<TD class=tableborderzero cmid="GalleryPage:Copy"><STRONG cmid="GalleryPage:Copy">E-mail Address</STRONG></TD>
<TD colSpan=3 cmid="GalleryPage:Copy"><INPUT id=email size=30 value=email name=email></TD></TR>
<TR cmid="GalleryPage:Copy">
<TD class=tableborderzero vAlign=top cmid="GalleryPage:Copy"><STRONG cmid="GalleryPage:Copy">Home
Address</STRONG></TD>
<TD colSpan=3 cmid="GalleryPage:Copy"><TEXTAREA id=homeaddress style="WIDTH: 333px; HEIGHT: 118px" name=homeaddress
rows=7 cols=34></TEXTAREA></TD></TR>
<TR cmid="GalleryPage:Copy">
<TD class=tableborderzero vAlign=top cmid="GalleryPage:Copy"><STRONG cmid="GalleryPage:Copy">Request</STRONG></TD>
<TD colSpan=3 cmid="GalleryPage:Copy"><TEXTAREA id=request style="WIDTH: 335px; HEIGHT: 116px" name=request rows=5
cols=18></TEXTAREA></TD></TR>
<TR cmid="GalleryPage:Copy">
<TD class=tableborderzero cmid="GalleryPage:Copy"></TD>
<TD class=tableborderzero cmid="GalleryPage:Copy"><BR><INPUT id=submit type=submit value=Submit
name=Submit> <INPUT id=reset type=reset value=Reset name=reset></TD>
<TD colSpan=2 cmid="GalleryPage:Copy"></TD></TR></TBODY></TABLE></FORM>[/HTML]