how to display checked checkboxes from comma separatedlist?

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. 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...
    5. 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 &...
  3. #2

    Default 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

  4. #3

    Default 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

  5. #4

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139