Alright I have a form, but I need to change the recepient of the email to change depending on the subject of the form. I am trying different htings and I think I am running in circles. I wat it to be an external fucntion to keep the email addresses away from bots. Any help would be great. Thanks
here is the js I am trying:
function AlterTo() {
if (document.contact.subject.value == “Press”) {
document.contact.recipient = “
}
if (document.contact.subject.value == “Advertising Sales”) {
document.contact.recipient = “
}
}
Here is the form:
<form action=”cgi-bin/smail.pl” method=”post” name=”contact” onSubmit=”return validateForm(this);”>
<input type=hidden name=required value=”name,email”>
<table>
<tr>
<td align=”right”><b>Name:*</b></td>
<td><input name=”name” type=”text” size=”35″ maxlength=”50″></td>
</tr>
<tr>
<td align=”right”><b>E-Mail:
<td><input name=”email” type=”text” size=”35″ maxlength=”50″></td>
</tr>
<tr>
<td align=”right”>Subject:</td>
<td><select name=”subject” style=”width: 245px;” onchange=”AlterTo();”>
<option>Select Subject
<option>———————
<option value=”Press”>Press</option>
<option value=”Advertising Sales”>Advertising Sales</option>
<option value=”Investor Relations”>Investor Relations</option>
<option value=”Business Proposals”>Business Proposals</option>
<option value=”Jobs”>Jobs</option>
<option value=”Site Comments”>Site Comments</option>
</select></td>
</tr>
<tr>
<td align=”right” valign=”top”>Comments:</td>
<td><textarea name=”comments” COLS=40 ROWS=8></textarea><br><span class=”sNotice”>1000 Character Limit</span>
</td>
</tr>
<tr>
<td colspan=”2″ align=”right”><br><input type=”submit” value=”Send” onclick=”return check();”> <input type=”reset” value=”Reset”></td>
</tr>
</table>
</form>