this is what I have so far..
on the form page I have 2 input boxes..
<td valign="top" class="#ClassName#" align="center">#quota_id#</td>
<td valign="top" class="#ClassName#" align="center"><input type="text" name="quotat_#quota_id#" value="#selQuotas.MONTHLY_TOTAL_QUOTA#" class="#ClassName#" size="10"></td>
<td valign="top" class="#ClassName#" align="center"><input type="text" name="quotad_#quota_id#" value="#selQuotas.MONTHLY_DSL_QUOTA#" class="#ClassName#" size="10"></td>
so I have
quota_id total_quota dsl_quota
1
2
3
4
5
6
7
with a submit button at the bottom... I want to process all changes.
on the processing page I have
<cfloop list="#form.fieldnames#" index="fieldname">
<cfset qid = mid(fieldname,find("_",fieldname,"1")+1,len(fieldname) - find("_",fieldname,1))>
<cfif left(fieldname,5) eq "quota">
<cfset value = evaluate("fieldname")>
<cfset quota = evaluate("form.#value#")>
<cfquery name="updQuotas" datasource="#dbDatabaseName#" username="#dbDefaultUsername#" password="#dbDefaultPassword#">
<cfif left(value,7) eq "quotat_">
update maintain_quotas
set MONTHLY_TOTAL_QUOTA = <cfqueryparam value="#quota#" cfsqltype="cf_sql_numeric">
where quota_id = <cfqueryparam value="#qid#" cfsqltype="cf_sql_numeric">
<cfelse>
update maintain_quotas
set MONTHLY_DSL_QUOTA = <cfqueryparam value="#quota#" cfsqltype="cf_sql_numeric">
where quota_id = <cfqueryparam value="#qid#" cfsqltype="cf_sql_numeric">
</cfif>
</cfquery>
this works but is there a more efficient way of doing this... it's updating the table twice per pass, 7 passes, so that's 14 updates.
******************************************************************************************
The information contained in this message, including attachments, may contain
privileged or confidential information that is intended to be delivered only to the
person identified above. If you are not the intended recipient, or the person
responsible for delivering this message to the intended recipient, ALLTEL requests
that you immediately notify the sender and asks that you do not read the message or its
attachments, and that you delete them without copying or sending them to anyone else.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

