/    Sign up×
Community /Pin to ProfileBookmark

Need some quick help if possible

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 = “[email protected]“;
}
if (document.contact.subject.value == “Advertising Sales”) {
document.contact.recipient = “[email protected]“;
}
}

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:*
</b></td>
<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>

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@StashXJan 13.2005 — bots can find [email][email protected][/email] if it is writen in source like this:
<i>
</i>document.contact.recipient = "[email protected]";

but they can't if it's writen like this:
<i>
</i>user="testing";
server="email.com"
document.contact.recipient = user+"@"+server;


so using this format you can put it internal...
×

Success!

Help @squiGGs spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...