I have coded a nice CF site, and have been able to do a lot of queries and updates. But this one, while so simple, I can't do.
I am really needing to see some examples or get some help.
I am pulling a list of units from a database. Putting them in a table within a form.
Each form field needs a unique name, and the number of records in the database can vary. The user is to check the box of the unit they want, and enter a quantity. The form will send that and the unit name and price to the action page. But I got stuck on the unique field names.
Then on the action page, the order will be simply sent in an e-mail, so I need to output the items selected. Not knowing the fieldnames, I get stuck here too.
Here is my Form code:
I have not written the action page yet.
<CFform
action="form_handler.cfm"
method="POST"
name="Form">
<div align="center">
<center>
<table border="0" width="85%">
<tr>
<td width="75" align="center" bgcolor="#800000"><font color="#FFFFCC"><b>Unit</b></font></td>
<td width="33%" align="center" bgcolor="#800000"><font color="#FFFFCC"><b>Quantity
Available</b></font></td>
<td width="34%" align="center" bgcolor="#800000"><font color="#FFFFCC"><b>Price</b></font></td>
<td width="34%" align="center" bgcolor="#800000"><font color="#FFFFCC"><b>Quantity
Needed</b></font></td>
<td width="34%" align="center" bgcolor="#800000"><font color="#FFFFCC"><b>Check
Box</b></font></td>
</tr>
<CFOUTPUT QUERY = "Annex1">
<tr>
<td width="75%" bgcolor="##FFFFCC">#unit#</td>
<input type="hidden" name="Unit" " Value = "#unit#">
<td width="33%" bgcolor="##FFFFCC">#quantity#</td>
<td width="34%" bgcolor="##FFFFCC">#price#</td>
<input type="hidden" name="Price" " Value = "#price#">
<td width="34%" bgcolor="##FFFFCC">
<p align="center"><input type="text" name="quant" size="10" Value = ""></td>
<td width="34%" bgcolor="##FFFFCC">
<p align="center"><input type="checkbox" name="selected" value="OFF"></td>
</tr>
</CFOUTPUT>
</table>
<!--Hidden Stuff-->
<CFOUTPUT Query = "UserInfo">
<input type="hidden" name="Email" Value = "#Email#">
</font>
<tr>
<td width="29%">
<p align="left"><b><font color="##800000">Your Name:</font></</td></b>
<td width="71%"><input type="text" name="sentby" Value = "#FirstName# #LastName#" size="50"></td>
</tr>
<font face="Tahoma, Century Gothic, Avant Garde, Arial, Helvetica">
<!--End Hidden Stuff-->
</cfoutput>
</center>
</div>
<p align="center"><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</CFform>
I am really needing to see some examples or get some help.
I am pulling a list of units from a database. Putting them in a table within a form.
Each form field needs a unique name, and the number of records in the database can vary. The user is to check the box of the unit they want, and enter a quantity. The form will send that and the unit name and price to the action page. But I got stuck on the unique field names.
Then on the action page, the order will be simply sent in an e-mail, so I need to output the items selected. Not knowing the fieldnames, I get stuck here too.
Here is my Form code:
I have not written the action page yet.
<CFform
action="form_handler.cfm"
method="POST"
name="Form">
<div align="center">
<center>
<table border="0" width="85%">
<tr>
<td width="75" align="center" bgcolor="#800000"><font color="#FFFFCC"><b>Unit</b></font></td>
<td width="33%" align="center" bgcolor="#800000"><font color="#FFFFCC"><b>Quantity
Available</b></font></td>
<td width="34%" align="center" bgcolor="#800000"><font color="#FFFFCC"><b>Price</b></font></td>
<td width="34%" align="center" bgcolor="#800000"><font color="#FFFFCC"><b>Quantity
Needed</b></font></td>
<td width="34%" align="center" bgcolor="#800000"><font color="#FFFFCC"><b>Check
Box</b></font></td>
</tr>
<CFOUTPUT QUERY = "Annex1">
<tr>
<td width="75%" bgcolor="##FFFFCC">#unit#</td>
<input type="hidden" name="Unit" " Value = "#unit#">
<td width="33%" bgcolor="##FFFFCC">#quantity#</td>
<td width="34%" bgcolor="##FFFFCC">#price#</td>
<input type="hidden" name="Price" " Value = "#price#">
<td width="34%" bgcolor="##FFFFCC">
<p align="center"><input type="text" name="quant" size="10" Value = ""></td>
<td width="34%" bgcolor="##FFFFCC">
<p align="center"><input type="checkbox" name="selected" value="OFF"></td>
</tr>
</CFOUTPUT>
</table>
<!--Hidden Stuff-->
<CFOUTPUT Query = "UserInfo">
<input type="hidden" name="Email" Value = "#Email#">
</font>
<tr>
<td width="29%">
<p align="left"><b><font color="##800000">Your Name:</font></</td></b>
<td width="71%"><input type="text" name="sentby" Value = "#FirstName# #LastName#" size="50"></td>
</tr>
<font face="Tahoma, Century Gothic, Avant Garde, Arial, Helvetica">
<!--End Hidden Stuff-->
</cfoutput>
</center>
</div>
<p align="center"><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</CFform>