Forum Moderators: coopster
This is not for a shipping cart. Basically they need to enter the type of a widget, then size and quantity of that item. I have a standard table that this information goes in to. Now, this is easy to do, but what I don't understand how to implement is sometimes the user needs to enter multiple types of widgets then the size and quantity of that type as well. The form only has options to enter one. Is there a way to have it so if a user clicks 'add another type' basically another <tr> pops up under the last one with new fields to enter the info? I don't want to have to put a whole bunch of rows there when most of the time they only need one row.
Is there a way to do that and then when the user click submit the info goes into multiple rows in a table.
Am I even making sense? heh
Thanks for looking.
-Russell
yes you are, strangely. ;)
It would depend on how it all works. Might you have the option before they get to that page to have them choose how many entries they need?
I think for the click and add a row you could post to itself maybe and load the desired number of rows with the default being one. Then reload the posted data into the existing rows.
product1 price1 quantity1
product2 price2 quantity2
product3 price3 quantity3
easy to create dynamically and parse values after. The processing script could do something like
$counter = 1;
while (isset(${product . $counter})) {
do stuff;
$counter++;
}
the form could be built with the rownum
echo "<form name=blah action=something>";
$counter = 1;
while ($counter <= $rownum) {
echo "<input type=text name=product",$counter,">";
echo "<input type=text name=price",$counter,">";
echo "<input type=text name=quantity",$counter,">";
}
echo "</form>";
or something like that.