Melissa 

I haven't seen an answer back to you yet, so here is one possibly way.
IF (assuming here) you are displaying all items for sale, with a text box to
enter number of each item customer wants to buy: i.e (123, Shovels,
garden,  []) (side comment you may want to display price):

<!--small change here, I would set default to 0(ZERO), for control and add a
hidden to pass idnumber --->
<INPUT type="text" name="Item_#equipment.id#" SIZE="5" WIDTH="10" value="0"
CLASS="monospace"> 

<INPUT type="hidden" name="Itemid_#equipment.id# value="#equipment.id#>


sample code for ACTION PAGE:

<CFQUERY name="equipment" datasource="DSN">
SELECT      ID
FROM         Equipment
ORDER BY  ID
</CFQUERY>



<CFOUTPUT query="equipment">
        <CFSET quanity = "#EVALUATE("item_#equipment.id#")#">
        <CFSET idnum = "#EVALUATE("itemid_#equipment.id#")#">
        <CFIF quanity GT 0>
                <CFSET soldequipment= #quanity#>
        <CFSET eqiuipmentid = #idnum#>
        </CFIF>
</CFOUTPUT> 


This will get you the to vars for use on your action page,  you can expand
on this to pass other vars you would want to work with.
you might want to look at using a <CFLOOP> index instead of the id from the
query.

let me know if this helps, if someone has given you a better way, please let
me know.  I have been working with this type of thing for awhile now and
haven't gotten very far myself.






-----Original Message-----
From: Melissa Fraher [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 18, 2001 1:32 PM
To: CF-Talk
Subject: Newbie question -- Dynamic form processing


Hello everyone.
How do you handle processing dynamic forms?

Here is my example code:

<CFQUERY name="equipment" datasource="DSN">
SELECT      ID, Category, Item
FROM         Equipment
ORDER BY  ID
</CFQUERY>

<HTML>
<BODY>

<FORM METHOD="post" action="ActionPage.cfm" >

<TABLE>

  <TR>
 <TD CLASS="title" WIDTH="141" HEIGHT="13">ID</TD>
 <TD CLASS="title" WIDTH="141" HEIGHT="13">Category</TD>
 <TD CLASS="title" WIDTH="248" HEIGHT="13">Item</TD>
 <TD CLASS="title" WIDTH="91" HEIGHT="13">Quantity
    </TD>
  </TR>

<CFOUTPUT query="equipment">
<TR>
 <TD CLASS="text" HEIGHT="5">#equipment.ID#</TD>
 <TD CLASS="text" HEIGHT="5">#equipment.category#</TD>
 <TD CLASS="text" HEIGHT="5">#equipment.item#</TD>
 <TD CLASS="text" HEIGHT="5">

 <INPUT type="text" name="Item_#id#" SIZE="5" WIDTH="10" value=""
CLASS="monospace">

 </TD>
</TR>
</CFOUTPUT>

</FORM>
</BODY>
</HTML>


This code will generate a form with over 150 text boxes.  The user
should be able to order more than one item.

Any suggestions on a clever way to process this form would be greatly
appreciated.

I would hate to hard code Item_1, Item_2, Item_3.....Item_150.

Thanks in advance.

Melisas
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to