I have no idea what you are asking for. I can tell you, however, that if there is more than one record returned (which makes more than one iteration for CFOUTPUT) you will have more than one form with the same name. Each form would have to have a unique name/id.

Probably best to have the form tags outside of the cfoutput (making one form for the page) with one submit button. In this case, if the checkboxes have the same name they will become (upon form submit) an object that can be treated as an array or list (ie, if you have three records and the checkbox values are 1, 2, and 3, they become "1,2,3" when the form is submit.)

06-04-2012, 05:37 AM

theborg72

Quote:

Originally Posted by WolfShade

I have no idea what you are asking for. I can tell you, however, that if there is more than one record returned (which makes more than one iteration for CFOUTPUT) you will have more than one form with the same name. Each form would have to have a unique name/id.

Probably best to have the form tags outside of the cfoutput (making one form for the page) with one submit button. In this case, if the checkboxes have the same name they will become (upon form submit) an object that can be treated as an array or list (ie, if you have three records and the checkbox values are 1, 2, and 3, they become "1,2,3" when the form is submit.)

But if I have a link / image that I want to run the update on the record that the check boxes are selected.
Check boxes are there only because I have to specify which post I want to update

but if I put checkbox value="#recTest.AlbID#"
so it should be possible to create the link (url: uppdate.cfm?ID=(value checkbox)

06-04-2012, 01:37 PM

WolfShade

It would be (IMHO) better and more efficient if you have only one form, submit the list of ID's to the processing page, and iterate through the list for processing. Several forms on the same page is overkill, and the link doesn't really "submit" the form, rather it just redirects to a new page with a URL parameter. So why have a form, at all?

06-04-2012, 02:03 PM

theborg72

it is inventory page. on the first page is the inventory. from there you can update, delete or add new inventory. form lists the items they found.

from there, I would be able to choose one of them and be able to update or delete the record

06-04-2012, 02:10 PM

WolfShade

With each record having its own form, you will only be able to delete one at a time; with one form, you can delete many at once.

As your code already shows, the link would be good for editing, since you only need to edit one record at a time, so now I understand that part.

06-04-2012, 02:23 PM

theborg72

Quote:

Originally Posted by WolfShade

With each record having its own form, you will only be able to delete one at a time; with one form, you can delete many at once.

As your code already shows, the link would be good for editing, since you only need to edit one record at a time, so now I understand that part.

yes thats it..I just want to go in and change one at a time.
Therefore, I use a checkbox to do this

06-04-2012, 02:29 PM

WolfShade

You don't need a checkbox or a form, for that. The link that you have already will do that. The checkbox (in a single form, not one for each) will allow multiple deletes. If you don't want the option of deleting more than one at a time, the form is pretty much useless.

If you insist on having one form for each record, then you need to do something to give each form a unique name and ID; like appending the currentRow to each. That will give each form a unique name and ID. But, again, this will only allow for one delete at a time. Kind of annoying if you have to delete ten or more, to do them one at a time.

06-04-2012, 05:30 PM

theborg72

Quote:

Originally Posted by WolfShade

You don't need a checkbox or a form, for that. The link that you have already will do that. The checkbox (in a single form, not one for each) will allow multiple deletes. If you don't want the option of deleting more than one at a time, the form is pretty much useless.

If you insist on having one form for each record, then you need to do something to give each form a unique name and ID; like appending the currentRow to each. That will give each form a unique name and ID. But, again, this will only allow for one delete at a time. Kind of annoying if you have to delete ten or more, to do them one at a time.

I have a primary key in the database that gives it a unique name. That it only goes with one record at a time is the point. do not want to have one of each but only one that goes to everything.