?
Solved

Update multiple rows/records at the same time

Posted on 2011-10-07
8
Medium Priority
?
474 Views
Last Modified: 2012-05-12
Hi,
is there a way to update all rows/records at the same time (one click) rather having indidual update button in each row? (see sample image attach).  User can update in any record (except ID column).

thanks,
pl
sample.gif
0
Comment
Question by:pdd1lan
8 Comments
 
LVL 3

Assisted Solution

by:karl-henrik
karl-henrik earned 500 total points
ID: 36929121

Yes you can and I think this blogpost will help you out quite nicely (better then me trying to explain).
http://www.coldfusionjedi.com/index.cfm/2009/2/10/Ask-a-Jedi-Updating-multiple-records-at-once

Have a nice day.
//Karl.
0
 
LVL 8

Author Comment

by:pdd1lan
ID: 36930726

I know how to update multiple records for one specific column, but this case I have multiple records in multiple columns that needs updating at the same time.
0
 
LVL 39

Assisted Solution

by:gdemaria
gdemaria earned 500 total points
ID: 36931304
So concept, but more fields...  the form would be something like this...

 <form method="post">
  <table>
  <cfoutput query="getUser">
      <tr>
         <td><input type="text" name="firstName#ctr#" value="#getUser.firstName#" /></td>
         <td><input type="text" name="lastName#ctr#" value="#getUser.lastName#" /></td>
         <td><input type="text" name="color#ctr#" value="#getUser.color#" /></td>
      </tr>
  </cfoutput>
  </table>
  <input type="submit" name="save" value="Save" />
</form>


In your action page, you would get form variables...

FORM.FirstName1
FORM.FirstName2
FORM.FirstName3
...

FORM.LastName1
FORM.LastName2
FORM.LastName3
... etc...

You would loop through them using this notation to access the value   #form['firstName' & kk]#    
where KK is the row number you're processing...

0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 39

Expert Comment

by:gdemaria
ID: 36931310
should have been..
Same concept, but more fields
0
 
LVL 16

Accepted Solution

by:
Gurpreet Singh Randhawa earned 1000 total points
ID: 36935676
0
 
LVL 8

Author Comment

by:pdd1lan
ID: 36935903
myselfrandhawa,  it might be what I am looking for.  I will test it on Monday. thanks for the link
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 36936055
pl, I think you should restate your question to be more clear.   The first two posts show how you can update multiple records with one save button, and myselfrandhawa is indicating how to do so but those records are a child record of a parent.

Can you tell us what you're after and in what way these posts don't answer your question?
0
 
LVL 8

Author Closing Comment

by:pdd1lan
ID: 36954488
thank you all for helps.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Loops Section Overview
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question