Close.  You need form["typeid_#i#"], not form.typeid_[i].

cheers,
barneyb

On 7/23/05, Pete Ruckelshaus <[EMAIL PROTECTED]> wrote:
> I want to take a set of sequentially numbered form field names (typeid_1,
> typeid_2, typeid_3, typedetails_1, typedetails_2, typedetails_3, and so on)
> and loop through them to create a query object. I could do this the hard way
> (i.e. 7 nearly identical blocks of code), but I would prefer to do this the
> right way, but for the life of me I can't remember the proper syntax for
> using the index values in variable names. Here's the code I have now (that
> doesn't work):
>  <cfscript>
> qryDetails = queryNew("dataCardID,typeid,details,display_order");
> for (i = 1; i LTE 7; i = i + 1) {
> if (NOT isNullNumeric(FORM.typeid_[i])) {
> queryAddRow(qryDetails);
> querySetCell(qryDetails,"dataCardID",insertDataCard.dataCardID);
> querySetCell(qryDetails,"typeid",FORM.typeid_[i]);
> querySetCell(qryDetails,"details",trim(FORM.typedetails_[i]));
> querySetCell(qryDetails,"display_order",i);
> }
> }
> </cfscript>
>  What am I doing wrong?
>  Thanks
>  Pete

-- 
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 50 invites.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212685
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to