CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Update multiple records in grid with values from a form???

Print topic Send  topic

Author Message
VBAjedi


Posts: 34
Posted: 02/16/2004, 2:49 PM

I want to create a grid (I don't care if it's editable or not) with a checkbox on each row (similar to the "Delete" checkboxes in an editable grid). Then at the top of the page I want a form (similar to a record form) with a field for each column of the grid.

When values are entered into some or all fields of the form and the form's "Update Selected Records" button is clicked, I want those values to be inserted into the appropriate fields of all "checked" records.

I can't be the first person that has needed this. Can someone give me some guidance on how to approach it? None of the CCS Example Pack examples resemble this, and I can't find anything in the forums addressing it.

Thanks!
_________________
VBAjedi
jedi at NOSPAM dot obie dot com
View profile  Send private message
peterr


Posts: 5971
Posted: 02/18/2004, 1:42 AM

Hmm, since no one is responding, you might be the first person that has needed this :-)
Though I recommend that you post here a URL to any other Website or Web page that has such feature/functionality. Once users can see how this can be implemented without CCS then they might get ideas how to do the same in CCS.

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
VBAjedi


Posts: 34
Posted: 02/18/2004, 9:38 AM

Thanks for the response, Peter! Problem is, what I'm building (and what this would be especially useful for) is a web-based inventory management system, and other companies aren't exactly keen to let me look at how they set up their system! So I don't HAVE any working examples of this.

It's always a bit embarassing to let other coders see a half-baked project, but I can publish my mockup page on my development server for a week so you can see what I'm after. Go to:

http://65.73.187.44/login.php

and login as "tempview" with password "limited".

Under the "Spaces" drop-down menu, check out "Edit Space Avails" to see what I want it to look like. By the way, this is the drop-down menu (dynamically generated from a MySQL table based on users access priveledges and current location in the site) that I was asking for help in another thread recently. It was encouraging to get one thing working like I had envisioned. <grin>

Thanks for your help!
_________________
VBAjedi
jedi at NOSPAM dot obie dot com
View profile  Send private message
peterr


Posts: 5971
Posted: 02/18/2004, 11:58 AM

Well, I still think that the best approach is to find any Website that already has such functionality fully implemented. Then you can see how they're doing it. Otherwise you might be indeed the only person who needs this, which means that you'd need to invent a few things (necessity is the mother of invention) :-)
You most likely will need to use some JavaScript, therefore again, finding an already existing application, especially Open Soruce, might provide you not only with new ideas, but possibly with the exact JavaScript code that you need.
And if no one else in the world has done this yet, then the question might by why? Maybe there is a different way to do this, I don't know.

Now, more practically, I think that you would need to create many (20) hidden fields in your "Edit Selected Spaces" form, then use "onchange" or "onclick" JavaScript in your Grid checkboxes that will automatically populate those hidden fields in the other form. Once "Edit Selected Spaces" is submitted, then you could use almost any event to read those checkbox values and update the appropriate records.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
VBAjedi


Posts: 34
Posted: 02/18/2004, 1:01 PM

Ok - I can't resist the challenge to potentially "Go where no man has gone before". :-) Tell me what you think about this approach:

1) Add a column to my table named "TransactionID"
2) Set the checkboxes return value to be a concatenation of a date/timestamp and the userID, and its control source to the new "TransactionID" field.
3) When user clicks "Submit" at the bottom of the editable grid, all checked records get this unique transaction ID written to the dbase. At the same time, the transaction ID is passed as a POST parameter to the record form at the top of the page, where it populates a hidden field. User inputs new value(s), and my update query writes those values to all records with that transaction ID.

Does that sound like it will work? I will probably need help on several of those steps. . .
_________________
VBAjedi
jedi at NOSPAM dot obie dot com
View profile  Send private message
peterr


Posts: 5971
Posted: 02/18/2004, 1:17 PM

I'm not sure if I fully understand your concept here, but it looks like you'd want to submit 2 forms at the same time, which is not possible. HTML standards don't alow for this.
Therefore you might need to use JavaScript to copy some information from one form to the other when only 1 form is submitted. You can copy checkbox values into multiple or a single Hidden field(s) on your record form - or vice versa: copy the record form's values into hidden fields within your grid's header or footer. Actually, the latter sounds more reasonable if you decide to use the "Submit" button below the grid. Then in your grid's events you could simply change the values to the ones obtained via POST. You would not even need to create a TransactionID or anything like this.
Though I may be wrong somewhere since I didn't work with such applications and didn't test such solution.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.