I have the form with mutiple text boxes for user to enter email addresses. It also has mutiple checkboxes for user to select devision they want to add these email addresses to.
How can i loop the divNo and emails and insert them into table. The code i have below is worked fine for emails but i dont know how to do for divNo. Can you please advice this?
<!---cfm--->
<form action="insert.cfm" method="post">
<input type="checkbox" name="divNo" value="ACCT" /> ACCT <br>
<input type="checkbox" name="divNo" value="FNA" /> FNA
<br>
<cfloop index="idx" from="1" to="5">
<input type="text" name="email" size="30"><br>
</cfloop>
</form>
!---insert.cfm--->
<cfloop list="#form.email#" index="x">
<cfquery name="insert_email" datasource="#variables.dsn#">
INSERT INTO [dbo].mytbl
([divNo]
,[email]
)
VALUES
(<cfqueryparam value="??" cfsqltype="cf_sql_integer" />,
<cfqueryparam value="#x#" cfsqltype="cf_sql_varchar" />,
)
</cfquery>
</cfloop>
Thanks