You could do this, it assumes the form element would always be passed but
might be blank.  If the form element may not get passed then you could do a
cfparam but that would not handle if it passed and blank.  Also I assumed
#gpIDX# was really supposed to be #idx#
<cfloop index="idx" list="#FORM.GROUPid#">
<cfif Trim(Form["group_sort_#idx#"]) IS "">
<cfset Form["group_sort_#idx#"] = 99 />
</cfif>
<cfquery name="update">
  UPDATE MyTable
  SET
 group_sort = #Form["group_sort_#idx#"]#
 where link_group = 'Form["thisGROUP_#idx#"]'
</cfquery>
</cfloop>

On Fri, Sep 5, 2008 at 10:25 AM, Les Mizzell <[EMAIL PROTECTED]> wrote:

> In the scenerio below, how would I set a default value - "99" maybe -
> for form.group_sort_#gpIDX# - if the form field was left blank?
>
>
> <cfloop index="idx" list="#FORM.GROUPid#">
>
> <cfquery name="update">
>   UPDATE MyTable
>   SET
>      group_sort = #evaluate("form.group_sort_#gpIDX#")#
>      where link_group = '#evaluate("form.thisGROUP_#gpIDX#")#'
> </cfquery>
>
> </cfloop>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:312065
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to