Thread: Form handling
View Single Post
Old 11-23-2005, 12:52 PM   #1 (permalink)
metazai
Regular Contributor
 
Join Date: Apr 2004
Location: Orange County, CA
Posts: 136
metazai is on a distinguished road
Form handling

Here's a fun, probably simple one that's eluding me entirely (ok, it's not fun -- but it IS probably simple and it IS eluding me).

I've got a standard HTML form, with a multiple select window -- options have a value of 1,2,3, and so forth . . . about 15 items, laid out like this.
Code:
<form action="apptform.php" method="get">
<select name="Procedures[]" id="Procedures" multiple size="3">
<option value="1" class="form_mult">Acne, Acne Scar & Rosacea Treatment</option> ...
On the following page, a more "detailed" form provide a few more things to fill out, and I want the multiple select window (which will have the exact same options) to reflect the users choice on the previous page, and allow them to change it. So on the next page I've coded:

Code:
<select name="Procedures_two" id="Procedures_two" multiple size="6">
<option value="1" class="form_mult" <?php if ($_GET['Procedures[0]'] = 1)
{echo ("selected=\"selected\"");} ?>>Acne, Acne Scar & Rosacea Treatment</option> ...
.

But it doesn't work, or I wouldn't be telling you about it here. It seems to select everything the php script is placed on, regardless. What am I missing here? Any ideas?
metazai is offline   Reply With Quote