Instead of the Counting why not do the 
CFLOOP LIST=#FORM.DIS_SITE_ID# INDEX=siteID

That way you do not need to know how many
times to run through the loop, just that it will
process each element in the list. Which if multiples
are selected, it would be comma delimited anyway.



>>> [EMAIL PROTECTED] 03/18/03 09:25AM >>>
I've got a dynamicly created selection in a Multi select combo box,
the
values are all numeric. I want to be able to get the count so that I
can
insert each selection in to a database.

Explanation:

At form you can select mutipuls selections in multi combo box.

On submit the process page will get number of selections so that I have
a
max number for a CFLOOP so that each selection will be inserted in as
a
seperate record.

Code Example:

<cfset mylist = "#FORM.DIS_SITE_ID#">
<cfset count = ListValueCount(mylist, value)> <!--Not sure what the
value in
the listvaluecount needs to be--->

<cfloop index="siteid" from="1" to="#count#">
  <cfoutput>
      <cfquery datasource="#dsn#">
           Insert into  SITE_ON_STUDY_T
                ( STUDY_ID,
                EVENT,
                DIS_SITE_ID,
                <CFIF isdefined("OTHER_SITE") AND len(trim(OTHER_SITE))
neq
0>OTHER_SITE,</CFIF>
                UserId,
                CREATE_DATE )
           Values
                ( #Study_Id#,
                1,
                #siteid#,
                <CFIF isdefined("OTHER_SITE") AND len(trim(OTHER_SITE))
neq
0>'#metastasis_site_other#',</CFIF>
                #cookie.userid#,
                #createODBCdatetime(now())# )
      </cfquery>
  </cfoutput>
  </cfloop>

Any thoughts?

Thanks in advance

Ernie Pena



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to