Looking for help with the code below -
The idea is to locate comma delimited data (checkbox values gathered from dynamic form to dynamic table) and separate it out so that each value can be checked against a value in a table to retrieve an email address.
The issue is that it stops checking the array value against the table after the first increment. And I guess I have looked at it too long because I can't see the forest for the trees...
Any help is MOST APPRECIATED!
thanks
'============================ASP CODE============================================== =====
If instr(RSEnduserData(myCol),",") <>0 then
response.Write("There is more than one answer for this question.<BR>")
ansArray=split(RSEnduserData(myCol),",")
u=ubound(ansArray)
for i=i to u
response.write("Array Answers: "& ansArray(i)&"<BR>")
myArr=ansArray(i)
Set rsContactsToAnswers = Server.CreateObject("ADODB.Recordset")
rsContactsToAnswers.Open "Select* from ContactsToAnswers where QID='"&myQ&"'", Conn, 2, 2
if rsContactsToAnswers("Answer")=ansArray(i) then
if rsContactsToAnswers("level")="1" then
response.write(rsContactsToAnswers("contactEmail") &" QID="&myQ&"<BR>")
end if
end if
rsContactsToAnswers.close
next
end if
'==========================================OUTPUT= ================================================
Column Name:Q22 == 22
Enduser Answer: Mickey Mouse
Column Name:Q23 == 23
Enduser Answer: this is a test of the email routing
Column Name:Q24 == 24
Enduser Answer: DD
Column Name:Q25 == 25
Enduser Answer: BB, JJ, GJ, MM, DD
There is more than one answer for this question.
Array Answers: BB
[email protected] QID=25
Array Answers: JJ
Array Answers: GJ
Array Answers: MM
Array Answers: DD
===============================TABLE DATA============================================== ==========
Answer ContactEmail Flag Level instanceNum QID ContactID
BB
[email protected] BB 1 60 25 1483
GJ
[email protected] GJ 1 60 25 1484
MM
[email protected] MM 1 60 25 1485
JJ
[email protected] JJ 1 60 25 1486
DD
[email protected] DD 1 60 25 1487