You can loop over your form fields (form is a structure) with code like
this:

<cfloop collection="#form#" item="aFormFieldName">
  <cfif Left( aFormFieldName, 9 ) is "boothtype">
    <cfset i = Right( aFormFieldName, Len( aFormFieldName ) - 9 ) />
    <cfquery...>
        appropriate SQL here. Now that you have a value for "i", you can
use Evaluate() to get the values of specific fields such as Evaluate(
'form.boothqty' & i )
    <cfquery>
  </cfif>
</cfloop>

-----Original Message-----
From: Terry Hilton [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, June 11, 2002 12:33 PM
To: [EMAIL PROTECTED]
Subject: Dynamic Form Fields


As part of an application that I am building, I have some dynamically
named form fields that need to be added to a SQL 2000 db.

ex.
boothtype1 [checkbox], boothqty1 [text field]
boothtype2 [checkbox], boothqty2 [text field]
boothtype3 [checkbox], boothqty3 [text field]

For each boothtype that is checked, I need to create a record in the
table with the exhibitorid, boothtype and boothqty. Can anyone suggest a
good way to do this?

BTW - I am also using the cf_reuseform tag with this form.

Thanks,

Terry Hilton
Web Developer
Two and One, Interactive

==^================================================================
This email was sent to: [email protected]

EASY UNSUBSCRIBE click here: http://topica.com/u/?bUrFMa.bV0Kx9
Or send an email to: [EMAIL PROTECTED]

T O P I C A -- Register now to manage your mail!
http://www.topica.com/partner/tag02/register
==^================================================================



Reply via email to