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
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

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

Reply via email to