I have a html/php form like the following:
Form 1:
Apple
options:
-big
-medium
-small
Submit button
Form 2:
Orange
options:
-big
-medium
-small
Submit button
Table:
Items
id
user_id
fruit_type
size
Question:
Currently, user has to click on “Submit” on each of the fruit they want to resize. Is there any way to combine this into one form so user can click submit all size-options once they finished choosing them? I don’t know how to write a Mysql query that can handle this because the fruit_type is different on both forms.
Secondly, how do you make the form “remember” user’s current size setting and default to that selection.
your html form could be like this :
Then in your php where you are getting the values you will have $_POST[‘apple’] and $_POST[‘orange’] with the selected values for each one.
With the 2 values, simply write 2 INSERT queries.