Folks, I have a form that displays several posible selections (from a database query) as checkboxes on a form. The code below displays those choices correctly;
I am hoping that the code above in red is naming each checkbox with a unique name and number. If this is correct way to do that, how do I then loop through those fields and e-mail only the selected values? Here is the code I am using to e-mail the rest of the values on the form;
I have tried something like this, but it did not seem to work correctly;
Thanks in advance...
Greg Grewe
West Chester, Ohio
Code:
<%
query = "select * FROM qry_MinistriesandTimes"
set rs = con.execute(query)
html_str = ""
RecordNumber = 1
do while not rs.eof
html_str = html_str & "<tr><td><td><td>" & rs("SMM DESCRIPTION") & " - " & _
rs("SMT DAY") & " - " & rs("SMT TIME") & [COLOR=red]"<td><input type=checkbox name=ministry" & _
RecordNumber & [/color]"size=50 value=1>"
rs.movenext
RecordNumber = RecordNumber + 1
loop
rs.close
response.write html_str
%>
I am hoping that the code above in red is naming each checkbox with a unique name and number. If this is correct way to do that, how do I then loop through those fields and e-mail only the selected values? Here is the code I am using to e-mail the rest of the values on the form;
Code:
...
html_str = html_str & "<table cellspacing = 10>"
html_str = html_str & "<tr><td align=right><font color='#0000FF'>Minister:</font><td>" & request("minister")
...
then I create the e-mail object and
loMail.HTMLBody = header_str & begin_str & html_str
I have tried something like this, but it did not seem to work correctly;
Code:
query = "select * FROM qry_MinistriesandTimes"
set rs = con.execute(query)
RecordNumber = 1
do while not rs.eof
if request("ministry" & RecordNumber) = 1
html_str = html_str & "<tr><td><td><td>" & rs("SMM DESCRIPTION") & " - " & _
rs("SMT DAY") & " - " & rs("SMT TIME")
end if
rs.movenext
RecordNumber = RecordNumber + 1
loop
rs.close
%>
Thanks in advance...
Greg Grewe
West Chester, Ohio