View Full Version : Backed myself into a corner?
h8ids
09-12-2006, 08:43 PM
I have a dynamic page that pulls from four different tables.
Each table has a dropdown box to display present entries.
The idea of the page is to allow the user to view, edit, add and delete the database entries.
Presently, I have several edit and add fields hidden in the page FORM and they appear when called. Works fine.
Now I'd like to set up the submission part for the edit and add tools. It looks as though I need to set up additional FORMS on the same page. One for each database entry. This brings the total number of FORMS to five. (Four of them would be located in the present form.)
Diagram:
OPENING OF MAIN FORM
OPENING OF SUB-FORM ONE
CLOSING OF SUB-FORM ONE
OPENING OF SUB-FORM TWO
CLOSING OF SUB-FORM TWO
OPENING OF SUB-FORM THREE
CLOSING OF SUB-FORM THREE
OPENING OF SUB-FORM FOUR
CLOSING OF SUB-FORM FOUR
CLOSING OF MAIN FORM ONE
Before I go to far... can this be done?
Fumigator
09-13-2006, 02:00 AM
I'm confused, why do you need more than one form?
ronaldb66
09-13-2006, 08:33 AM
It would help if you would supply some more detail about this edit form, but it sounds like everything could be done in a single form. If all the data from the four tables is presented in one form and the edits are all processed after a single submit, you wouldn't need separate forms.
h8ids
09-13-2006, 02:41 PM
I'm thinking multiple forms are necessary because data will be saved to four different tables. I want to ensure the Added / edited data is table specific.
Using one form to save all data could, to my knowledge, create uneccesary data thus slow the processing and net transfer.
The main form just draws all data.
Another option I'm working with is capturing new data into a PHP global variable, passing it to another page and then storing the data. Each Submit button would call a separate page for data storing.
ronaldb66
09-13-2006, 03:20 PM
I'm still confused about the fifth form; apart from the fact that I'm not sure forms are even allowed to be nested (just think about what a submit of the outer form would mean), I see no reason why you couldn't populate your four forms by themselves with data from the four tables, and have them each be submitted independently from oneanother.
As I see it, you have two options, depending on whether you want to: 1. update all four tables in one go (which you seem not to), or 2. update them each independent of the others:
Populate one form with data from all four tables; submit and process any altered data in one action for all four tables;
Populate four independent forms, each from its own table--albeit all on one page--and submit and process any alter data for each table independently, in four separate actions.
h8ids
09-13-2006, 03:33 PM
Your right. Forms can't be nested within each other.
Going with one form. (Which was needed to hide SPANs.)
I'm learning several languages at once; didn't think to provide info about SPAN use in the Main form.
Calling separate pages for each Submit button should solve the challenge.
Thanks guys for your input.
I'm still confused about the fifth form; apart from the fact that I'm not sure forms are even allowed to be nested (just think about what a submit of the outer form would mean), I see no reason why you couldn't populate your four forms by themselves with data from the four tables, and have them each be submitted independently from oneanother.
As I see it, you have two options, depending on whether you want to: 1. update all four tables in one go (which you seem not to), or 2. update them each independent of the others:
Populate one form with data from all four tables; submit and process any altered data in one action for all four tables;
Populate four independent forms, each from its own table--albeit all on one page--and submit and process any alter data for each table independently, in four separate actions.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.