Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
MartinC #1
how to display checked checkboxes from comma separatedlist?
I have a conference registration page that displays information from a database:
-Membership info comes from a members table.
-Conference info comes from a conferences table.
-Session info comes from a sessions table.
This page serves as both an 'add registration' page and an 'update
registration' page.
Visitors to this page select sessions they want to attend by checking a
checkbox. Via a registration action page, their selections end up as a comma
separated list (18, 12, 7, 2, 5, 9,) in the SID field of the registrants table.
How can I make their session selections appear as checked checkboxes on the
registration page when they visit this page as an update page?
This is the code I have for displaying the sessions list with checkboxes...
<table width="79%">
<tr align="left" valign="top">
<td width="7%"><strong>Session ID</strong></td>
<td width="38%"><strong>Title</strong></td>
<td width="17%"><strong>Fee</strong></td>
<td width="38%"><strong>Register by checking box </strong></td>
</tr>
<cfoutput query="getSessions">
<tr align="left" valign="top">
<td>#numberFormat(SID, '0000')#</td>
<td>#sessionTitle#</td>
<td><cfif sessionFee EQ 0>incl.<cfelse>#sessionFee#</cfif></td>
<td><input name="SID" type="checkbox" value="#getSessions.SID#" /></td>
</tr>
</cfoutput>
</table>
Thanks for any assistance that can be provided!
Cheers,
Martin
MartinC Guest
-
CheckBoxes in DataGrids-- the "checked" attribute not correct after posting page?
Hi everyone, I'm using a DataGrid with TemplateColumns. My DataGrid is located in a cell of an asp:Table. I did this so it's positioned... -
Checkboxes Always Checked in ColdFusion 7 when usingPreserveData
There seems to be a bug in how preserveData is handling checkboxes. I have noticed that if CFFORM.preserveData is set to True and... -
How do I loop through checkboxes and set them as Checked?
I have a Datagrid where there is a Checkbox in the Header. When the user clicks on this checkbox, I want all the checkboxes in each row to show as... -
Checkboxes in fillable PDF don't stay checked
I am creating an evaluation form in fillable PDF. There are a series of questions, then five checkboxes next to five ratings (superior excellent good... -
display data with no end comma
Preferably, you can move the array to getrows, then use join() Or, if you really want to loop, you could build a string: str = str &... -
Kronin555 #2
Re: how to display checked checkboxes from commaseparated list?
<input name="SID" type="checkbox" value="#getSessions.SID#"<cfif listfind(MySessionList,getSessions.SID) neq 0> checked</cfif>/>
Kronin555 Guest
-
OldCFer #3
Re: how to display checked checkboxes from commaseparated list?
Theres a couple of things:
1) You should not store values in a comma separated list. Each value should
be a new row in a table linked to the membership / conference combination.
2) If, as you say the SID is a comma separated field, can you do a
#numberFormat(SID, '0000')# on it?
3) Setting the checkbox to "#getSessions.SID#" means you've asigned it a
list value. Now the lists will further combine with other lists.
OldCFer Guest
-
Dixbert #4
Re: how to display checked checkboxes from commaseparated list?
Anyone know how to do it in a format="flash" form with a cfinput type="checkbox" form control? Oh, and the checkbox is in a repeater driven by a query.
Dixbert Guest



Reply With Quote

