Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I want to use cfloop but....

Status
Not open for further replies.

johnhig

MIS
Jun 25, 2007
54
0
0
US
Hi Everyone,

I have a form that has fields to it. I want the user to be able to enter up to 15 entries. I used a loop to have the additional rows display...

here is the form code.
<tr>
<td width="48">&nbsp;</td>
<td width="48">Date</td>
<td width="1">&nbsp;</td>
<td width="139">Customer</td>
<td width="1">&nbsp;</td>
<td width="180">Destination</td>
<td width="8">&nbsp;</td>
<td width="84">Start Mileage</td>
<td width="6">&nbsp;</td>
<td width="85">End Mileage </td>
<td width="3">&nbsp;</td>
<td width="100">NY Thruway </td>
<td width="3">&nbsp;</td>
<td width="62">State</td>
<td width="1">&nbsp;</td>
<td width="62">Total</td>
</tr>
<tr>
<td><cfloop from = "1" to = "15" index = "tripentry">
<input name = "#tripentry#" type = "hidden" size="5" maxlength="5">
</cfloop></td>
<td><cfloop from = "1" to = "15" index = "tripdate">
<input name = "#tripdate#" type = "text" size="15" maxlength="15">
</cfloop></td>
<td>&nbsp;</td>
<td><cfloop from = "1" to = "15" index = "tripcust">
<input type = "text" name = "#tripcust#"></cfloop></td>
<td>&nbsp;</td>
<td><cfloop from = "1" to = "15" index = "tripdest">
<input type = "text" name = "#tripdest#"></cfloop></td>
<td>&nbsp;</td>
<td><cfloop from = "1" to = "15" index = "tripstart">
<input name = "#tripstart#" type = "text" size="10" maxlength="10">
</cfloop></td>
<td>&nbsp;</td>
<td><cfloop from = "1" to = "15" index = "tripend">
<input name = "#tripend#" type = "text" size="10" maxlength="10">
</cfloop></td>
<td>&nbsp;</td>
<td><cfloop from = "1" to = "15" index = "tripthru">
<input name = "#tripthur#" type = "text" size="5" maxlength="5">
</cfloop></td>
<td>&nbsp;</td>
<td><cfloop from = "1" to = "15" index = "tripstate">
<input name = "#tripstate#" type = "text" size="5" maxlength="5">
</cfloop></td>
<td>&nbsp;</td>
<td><cfloop from = "1" to = "15" index = "triptotal">
<input name = "#triptotal#" type = "text" size="5" maxlength="5">
</cfloop></td>
</tr>

Now I am stuck. I am trying to learn the cfloop so please be kind. I am reading my book and trying out the code on test pages.

The next piece I would want to do is just cfloop through on my action page to insert those records. So when I go to write my insert code I get confused. Do I just loop a formfield?

Any help is so greatly appreciated.
John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top