Forums

This topic is locked

mail recipient based on id selected

Posted 13 Mar 2007 20:51:05
1
has voted
13 Mar 2007 20:51:05 jeff mr posted:
we use the following on a youth hockey site for parents to volunteer, right now all the requestes are email to me, the id list is filled by ids avaliabe in the database and only lists id's that are current, the field is named ID_no and is a autonumber field, associated with it is a field named poster with the person who posted the volunteer times email address in it, is there a way for when the person filles out the form and hits submit it looks at the id selected and filles in the _recipient value with the persons email address associated with the ID_no in the database?
any help would be appreciated, thanks

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Volunteer Sign Up</title>
<base target="_self">
<link rel="stylesheet" type="text/css"
href="/css/mystyles.css">
<link rel="stylesheet" type="text/css"
href="/css/forms.css">
</head>
<!-- #include virtual ="include/formdisableenterkey.asp" -->
<body>
<!-- #include virtual="header_files/header.asp" -->
<div id=pagetitle>Volunteer Page</div>
<hr>
<div id=p4>Use this form to volunteer.</div>
<FORM name="myform" ACTION="cgi.bhi.com/scripts/sendmail.asp" METHOD="post">

<INPUT TYPE="hidden" NAME="_recipients" VALUE=" " />

<INPUT TYPE="hidden" NAME="_toname" VALUE="TRI-CITY" />
<input type="hidden" name="_redirect"
value="www.tcha.us/forms/thankyou.asp">
<INPUT TYPE="hidden" NAME="_subject" VALUE="TRI-CITY VOLUNTEER SIGN UP" />
<INPUT TYPE="hidden" NAME="body" VALUE="TRI-CITY VOLUNTEER SIGN UP" />
<input type="hidden" name="volunteer">
<input type="hidden" name="address">
<label for="user"><div id=p1>Name:</label>
<INPUT NAME="_fromname" TYPE="text" onkeypress="return handleEnter(this, event)" SIZE=50 MAXLENGTH=50><BR>
<label for="emailaddress"><div id=p1>Email:</label>
<INPUT NAME="_fromaddress" TYPE="text" onkeypress="return handleEnter(this, event)" SIZE=50 MAXLENGTH=50><br>
<label for="phone"><div id=p1>Phone:</label>
<INPUT NAME="phone" TYPE="text" onkeypress="return handleEnter(this, event)" SIZE=50 MAXLENGTH=50><br>
<label for="id"><div id=p1>ID#:</label>
<SELECT NAME="id">
<OPTION VALUE="Please Select">Please Select
<%
Dim adoCon
Dim rsvolunteer
Dim strSQL
Set adoCon = Server.CreateObject("ADODB.Connection"
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/Uploads/volunteer/volunteer.mdb"
Set rsvolunteer = Server.CreateObject("ADODB.Recordset"
strSQL = "SELECT tblComments.* FROM tblComments WHERE Status<>'Filled' AND Date1>= #" & DATE & "#;"
rsvolunteer.Open strSQL, adoCon
Do While not rsvolunteer.EOF
%>
<OPTION VALUE=<%Response.Write ("""" & rsvolunteer("ID_no" & """"%>><%Response.Write (rsvolunteer("ID_no")%>
<%
rsvolunteer.MoveNext
Loop
rsvolunteer.Close
Set rsvolunteer = Nothing
%>
</SELECT><BR><br>
<script type="text/javascript">
function doCalcAndSubmit() {
val1 = document.forms["myform"]._fromaddress.value;
val2 = document.forms["myform"]._fromname.value;
address = val1;
volunteer = val2;
document.forms["myform"].address.value = address;
document.forms["myform"].volunteer.value = volunteer;
document.forms["myform"].submit();
}
</script>
<input type="button" onClick="doCalcAndSubmit();" value="Submit">
<input type="reset" value="Reset">
</form>
<br /><br /><br /><br />
<!-- #include virtual="include/footer.asp" -->
</body>
</html>

Replies

Replied 25 Sep 2007 17:30:16
25 Sep 2007 17:30:16 Anthony Hamlin replied:
I have been trying the same thing. Have you havd any luck?

Reply to this topic