I am still pretty new a CF and could really use some help. I am trying to get each item that is checked from a page that generates the list automatically from a query and get the associated textbox text with it. For example:
<!--- Start Get Data Hierarchy List--->
<cfquery datasource="MyDatasource" name="qry_GetData">
SELECT C.taxonomy_id, C.lvl, C.taxonomy_name, C.taxonomy_tree, C.taxonomy_guid, C.taxonomy_standard_name
FROM dbo.taxonomy AS P
JOIN dbo.taxonomy AS C
ON P.taxonomy_id = 21
AND C.hid.IsDescendantOf(P.hid) = 1
AND C.lvl = 3
</cfquery>
<!--- Start Get Data Hierarchy List--->
| <cfloop query="qry_GetData"> | |||||||||
| <input type="checkbox" name="cbox_PE_SelTax#taxonomy_id#" value="#taxonomy_name#"><font size="4" color="3399FF"> #taxonomy_name#</font> | |||||||||
| <br /> | |||||||||
| - Details of experience with #taxonomy_name#:<input name="tbox_PE_SelTax#taxonomy_id#" id="tbox_PE_SelTax#taxonomy_id#" size="50%"> | |||||||||
| <br /> | |||||||||
| <br /> | |||||||||
| </cfloop> |
Give all your checkboxes the same name:
<input type="checkbox" name="cbox_PE_SelTax" value="#taxonomy_#"><font size="4" color="3399FF"> #taxonomy_name#</font> (Also, you might not want to use the FONT tag any more - it's been deprecated for quite some time. Try CSS instead.)
Then, in your action page, the value of Form.cbox_PE_SelTax will contain a list of all the taxonomy_id values for whichever boxes were checked. Note that I changed the value of the checkbox from taxonomy_name to taxonomy_id.
Dave Watts, CTO, Fig Leaf Software
Dave,
Thank you for your help so far. I must not be asking the right question. Here is the whole breakdown. I am writing this page to collect the users information, Name, Title, Company, and technologies they are familiar with. I then want that information emailed to me upon submission. The point I am running into a problem (even with your last post) is how to write the action part of it that will email the checked items to me. I cannot figure out if I need to use CFLOOP (if so, how) or what the best method is. I am a very visual lerner and can understand how code works easily, but I have not found any examples for my situation. Again, I really appriciate all of your help thus far.
Thank you!
North America
Europe, Middle East and Africa
Asia Pacific