quote:
<cfif isDefined("form.fieldnames") and
mid(form.fieldnames,1,4) is "Del_">
<cfloop index="i" list="#form.fieldnames#"
delimiters=",">
<cfset select_urdn_number = listlast(i,"_")>
<cfquery>
</cfloop>
<cfquery>? where's the </cfquery> and the body of
the tag?
furhter:
this line of yours does not make any sense:
<cfif isDefined("form.fieldnames") and
mid(form.fieldnames,1,4) is "Del_">
form.fieldnames is a list of all submitted for fields. thus
mid(form.fieldnames,1,4) is looking for first 4 characters of
the whole
list.
furthermore:
<cfloop index="i" list="#form.fieldnames#"
delimiters=",">
<cfset select_urdn_number = listlast(i,"_")>
you are looping through all field names one by one here. you
are not
setting any condition for the form field name like you do
later in your
code, so the second line above looks at EVERY fieldname, even
the ones
WITHOUT any _ in the name. obviously in such a case that line
will throw
an error.
if i understand your requirements correctly, all you need is:
<cfif isDefined("form.fieldnames")>
<cfloop index="i" list="#form.fieldnames#"
delimiters=",">
<cfif left(i,4) is "del_">
<cfset select_urdn_number = listgetat(i, 2, "_")>
<cfset select_urdn_line_item = listlast(i, "_")>
</cfif>
</cfloop>
</cfif>
PS: listgetat():
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_l_12.html
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/