another question about dynamic forms
| From: | Amanda McComb | Date: | Fri, 02 May 2003 20:55:45 +0000 |
| Subject: | another question about dynamic forms | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-146200@lists.php.net to get a copy of this message | ||
Ok, so, I have this form that has a drop down (populated by a table).
When someone chooses something from the dropdown, it submits the form and
- depending on what the user chose - lists sub categories beneath the drop
down. So, say the user chooses 'Bursar' from the dropdown, the page
refreshes and under the dropdown there is a list of Bursar activities
(Golf events, tours, etc). Next to the activity, there is a field for the
quantity of that activity they would like.
To get a better idea, here is the link:
http://12.222.75.125/amccomb/prodev/customer_form.php
My question is similar to my last question. How do I name that quantity
field so I can get the value back out again?
Here is what I have so far:
if ($conference_cd){
$query = "SELECT * FROM conference_component_t WHERE conference_cd
= $conference_cd AND (retired_flag is NULL OR retired_flag = 0) AND
component_cd != 1 ORDER BY conference_component_name";
$search_results = mysql_query($query) or die("Select Failed!");
?>
<?
while ($search_result = mysql_fetch_array($search_results)) {
?>
<TR>
<TD NOWRAP>
<?if ($search_result['conference_component_name'] != "") {?>
<?echo
stripslashes($search_result['conference_component_name'])?>
<?}else{?>
<? $subquery2 = "SELECT conference_name FROM conference_t
WHERE
conference_cd = $search_result[conference_cd]";
$lists = mysql_query($subquery2) or die("To edit a Conference,
you must
choose one from the list provided.");
$list = mysql_fetch_array($lists);?>
<?echo stripslashes(($list[0])); ?>
<? $query2 = "SELECT component_name FROM component_t WHERE
component_cd = $search_result[component_cd]";
$lists = mysql_query($query2) or die("To edit a Conference,
you must
choose one from the list provided.");
$list = mysql_fetch_array($lists);?>
<?echo stripslashes(($list[0])); ?>
<?}?>
</td>
<td ALIGN=center>
Price: $<? echo
$search_result['conference_component_price']?>
</td>
<td>
Quantity: <INPUT
TYPE="text"
NAME="<? echo
$search_result['conference_component_cd']?>"
SIZE="1"
MAXLENGTH="5"
VALUE="">
</td>
</TR>
<?
}
?>
<?}?>
So now, the quantity is named $2 or $34 or whatever the code is. But if I
want to print out all of the values for all of the quantities, how do I do
it?