Ask a Question related to Coldfusion Database Access, Design and Development.
-
Efused #1
Update multiple rows on form submission
Dont know why my brain is farting on this but I need to update a table's rows
after a form submission.
Basically the table has the following CountryID, CountryName, CountryRate1,
OnScroller.
I Select all rows from the table and output 1 single form with each country on
a line. Each line will allow you to edit the Name, and Rate values, as well as
Check or Uncheck the Onscroller value.
I'd like to be able to edit as many rows as I want and click "update".
The "display" page uses a cfoutput query loop to generate:
<cfoutput query="GetRates">
<cfif CurrentRow MOD 2 IS 1><cfset bgcolor="##eeeeee"><cfelse><cfset
bgcolor="##ffffff"></cfif>
<tr bgcolor="#bgcolor#">
<td><input type="text" name="CountryName" value="#CountryName#" size="40"
style="background-color:#bgcolor#;"></td>
<td align="center"><input type="text" name="CountryRate1"
value="#CountryRate1#" size="7"></td>
<td align="center">
<cfif OnScroller EQ 1><input type="checkbox" name="OnScroller" value="1"
checked>
<cfelse><input type="checkbox" name="OnScroller" value="1">
</cfif>
</td>
</tr>
</cfoutput>
The output looks great, how do I code the "update" page? I know I need to wrap
this up in a loop somehow.
Not sure how to set up the form variables and loop the update. Help?
Chris
Efused Guest
-
update multiple rows from one table
Hi, I have a Dynamically created formfield. Tgis field shows the attached devices off a selected device (for instance you have a pc and in the... -
Update multiple rows data with a single button
hello I have been trying to run multiple update queries based on the data entered by user. Brief background: I am fetching data from various... -
how can I update table with multiple rows
Hi I have to output some data from cfquery into a table with text boxes. These text boxes are updatable . If multple rows are updated how can I... -
multiple form submission
Can someone point me in the direction of a resource to learn how to submit multiple forms on a single page through a single submit button. The... -
Update multiple rows
Been working with Access and SQL Server for a long time. New to Oracle. I have two tables TableA & TableB. TableA has EmployeeID (PK),Salary,... -
Dan Bracuk #2
Re: Update multiple rows on form submission
One way is to use a cfgrid and cfgridupdate, if it works with your particular
database.
Another way is to use dynamic formfield names when generating your form, and
parse them out when processing it.
So instead of name="countryname", have name = "countryname#currentrow#"
There are a couple of recent threads regarding parsing the fieldnames when
processing your form.
Dan Bracuk Guest



Reply With Quote

