neomorpheus
Programmer
I a m currently developing an application that lets users subscribe to newsletters and am having trouble proceeding. I give the users a radio button option (Yes/No) to pick from. Based on what is picked/ not picked, I need to create a string which will be fed to a stored Procedure that inserts the data into a table. My problem is in creating that "String". My Form Fields debug output look like this:
--------------------------------
BI-WEEKLY=0
DD NEWSLETTER=0
EC=0
ESSA CC=1
FIELDNAMES=BI-WEEKLY,DD NEWSLETTER,EC,ESSA CC,INFO-DT,MK_COMM_YES,TALK LISTS,UPDATE
INFO-DT=0
MK_COMM_YES=1
TALK LISTS=0
UPDATE=Update Subscriptions
--------------------------------
The names of the newsletters comes from a table and hence dynamic. My resulting string based on whats selected needs to be in the form of:
BI-WEEKLY&0,DD NEWSLETTER&0,EC&0,ESSA CC&1,INFO-DT&0,MK_COMM_YES&1,TALK LISTS&0
Where "0" means unsubscribe (radio Uncheck) and "1" is Subscribe (Radio Checked) and the "&" is a deliniter that is used by the Stored Procedure.
This is the string that i need to submit to the Stored Proc and I need help creating this.
Please Help!
My Code:
*************************************************
<cfloop query = "qListRulesSelect">
<tr bgcolor="#tblbgcolor#">
<td><div align="left">
#qClientListRulesSelect.ListRule#
</div></td>
<td><div align="left">
#qClientListRulesSelect.ListRuleDescription#
</div></td>
<!--- The YES Radio Button --->
<td>
<div align="left">
<center>
<input type=radio name="#qListRulesSelect.ListRule#" <cfif qListRulesSelect.checked IS "1">checked</cfif> value="1">
</center>
</div>
</td>
<!--- The NO Radio Button --->
<td>
<div align="left">
<center>
<input type=radio name="#qListRulesSelect.ListRule#" <cfif qListRulesSelect.checked IS "0">checked</cfif> value="0">
</center>
</div>
</td>
</cfloop>
<tr bgcolor="#tblbgcolor#">
<td colspan=4><div align="left">
<center><input type="Submit" value="Update Subscriptions" name="Update" class=button></center>
</div></td>
</tr>
****************************************************
Thanks in advance.
--------------------------------
BI-WEEKLY=0
DD NEWSLETTER=0
EC=0
ESSA CC=1
FIELDNAMES=BI-WEEKLY,DD NEWSLETTER,EC,ESSA CC,INFO-DT,MK_COMM_YES,TALK LISTS,UPDATE
INFO-DT=0
MK_COMM_YES=1
TALK LISTS=0
UPDATE=Update Subscriptions
--------------------------------
The names of the newsletters comes from a table and hence dynamic. My resulting string based on whats selected needs to be in the form of:
BI-WEEKLY&0,DD NEWSLETTER&0,EC&0,ESSA CC&1,INFO-DT&0,MK_COMM_YES&1,TALK LISTS&0
Where "0" means unsubscribe (radio Uncheck) and "1" is Subscribe (Radio Checked) and the "&" is a deliniter that is used by the Stored Procedure.
This is the string that i need to submit to the Stored Proc and I need help creating this.
Please Help!
My Code:
*************************************************
<cfloop query = "qListRulesSelect">
<tr bgcolor="#tblbgcolor#">
<td><div align="left">
#qClientListRulesSelect.ListRule#
</div></td>
<td><div align="left">
#qClientListRulesSelect.ListRuleDescription#
</div></td>
<!--- The YES Radio Button --->
<td>
<div align="left">
<center>
<input type=radio name="#qListRulesSelect.ListRule#" <cfif qListRulesSelect.checked IS "1">checked</cfif> value="1">
</center>
</div>
</td>
<!--- The NO Radio Button --->
<td>
<div align="left">
<center>
<input type=radio name="#qListRulesSelect.ListRule#" <cfif qListRulesSelect.checked IS "0">checked</cfif> value="0">
</center>
</div>
</td>
</cfloop>
<tr bgcolor="#tblbgcolor#">
<td colspan=4><div align="left">
<center><input type="Submit" value="Update Subscriptions" name="Update" class=button></center>
</div></td>
</tr>
****************************************************
Thanks in advance.