473,396 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

figure out which form was submitted out of dynamically created forms.

Hey guys,

My main question is that can POST contain a variable instead of a string?

Im working on a problem with an application i am developing using html php and mysql. Part of the application im trying to develop consists of an inventory section. In this section the user can have multiple stores. Where im having difficulty is stock transaction.

How i have laid out this part of the application is that the user will click on a store from a list and a form will appear with a table consisting of all the items in that store which will be pulled from the database. Next to each item is a field to enter quantity and another field to enter any comments. after all the items are listed there is a submit button where form will be submitted.

As the number of stores is not predetermined, once the form is posted i have to come up with a way to find out which form is submitted. what i came up with was to list the stores again and create a loop which will check the number the store appears in the list, with the button that has been pressed (which i had named submit + the number in the list the store appears).

i.e.
store - number in list - name of submit button
store 1 - 0 - submit0
store 2 - 1 - submit1
store 3 - 2 - submit2
etc...

my theory is that i can use isset POST to find which button has been clicked, by creating a loop with a variable that will combine submit + the number of records in the store table in the database, i can find which form was submitted

i.e.
while $y<$x
$a = 'submit'.$a
if isset (POST($a))
...$y++

My main question is that can POST contain a variable instead of a string? I am beginning to think that it is not possible. is there any other way by which i can figure out which form was submitted out of the dynamically created forms.


Thanks alot for your time.
Nov 2 '11 #1
0 1327

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: - vhannak | last post by:
I have a main form that can create and display multiple other (sub)forms at the click of a button. Each time a new subform is created, I want the main form to increment a counter to indicate how...
2
by: D Hass | last post by:
Radio Buttons are added to my form During the Load event, the quantity determined by User input. They are placed in pairs on groupboxes with code like this: (edited a bit for brevity) Public...
1
by: lanmou | last post by:
hi, Iam developing a application where a form displays dynamically created contols and displays data in it from the database. this form allows the user to edit records and any changes made to it...
4
by: assgar | last post by:
Hi I am stuck on a problem. I use 3 scripts(form, function and process). Development on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. The form displays...
5
Tann3r
by: Tann3r | last post by:
Apache.v2.2.4, MySQL.v5.0.27, PHP5.2.1 I have a table of projects which has been dynamically created from an SQL query. I have several dropdown boxes which have been populated from other tables...
0
by: MTurner | last post by:
Hey guys i'm having some problems creating a program, i have an MDI parent with child windows that are created dynamically (since there is no way for me to know how many are going to be created)...
3
by: Studlyami | last post by:
I have a MFC dialog in which buttons get dynamically created on the page. I use a ON_CONTROL_RANGE(BN_CLICKED, 10000,10500, OnBnClicked) and this captures any left click on the button and it works...
3
by: raghulvarma | last post by:
I have created only one object for the textbox and that particular textbox is being repeated as many times I want.But if I want to add the values in the database from each and every textbox which...
1
by: semomaniz | last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel dynamically and inside this panel i created tables. I have...
1
by: Mayan F | last post by:
If you're into that maybe you could help me with another thing I'm upto now: I succeeded in dynamically creating the controls but now I'm trying to dynamically create a form for these controls(to...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.