Code:
<script type="text/javascript">
var addresses = [
"adam@mysite.com",
"marcus@mysite.com"
];
function updateMail(frm, val) {
frm.elements.mailto = addresses[val];
}
</script>
<select onchange="updateMail(this.form, this.selectedIndex);" name="category">
<option value="1">Category 1</option>
<option value="2">Category 2</option>
</select>
However, a server-side solution would definitely be preferable -- it would neither break the script for non-JS users nor reveal the email addresses to potential spambots.
Bookmarks