I have been working on one single little problem for the past 10 hours. I have received help from multiple sources in multiple forums and nothing has worked completly. My page-of-anger is http://www.localheroclothing.com/step2y.php. Here is what the page needs to do:
Let the user choose a product, which brings up the sizes and colors available for that product. When they submit the product specification it is added above the table (PHP_SELF) and they may add another. But my php keeps replacing the old data with the new.
I have tried to change the JS, I tried to use hidden fields, and I'm about to throw my computer out the window. My site has taken me months and this is the last part I need to finish.
<?php
$product = $_POST['select_1'];
$size = $_POST['select_2'];
$color = $_POST['select_X'];
$quantity = $_POST['quantity'];
?>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<?php
$rowsx=0+$inputrows;
if(isset($_POST["rowsx"])){
$rowsx=$_POST["rowsx"];
}
for($e=0;$e<=$rowsx;$e++){
?>
<tr>
<td><input type="text" value="<?php echo( $quantity .' - '. $product .' - '. $color .' - '. $size ); ?>" size="53">
</td>
</tr>
<?php
}
?>
</table>
<table><tr><td>
<input name="quantity" type="text" size="2">
</div></td>
<td><div align="center">
<span class="style2">Product</span>
<select name="select_1" id="productdd" onChange="switch_select(); switcher_select();">
<option>-- Products --</option>
<option value=12.99>T-Shirt</option>
<option value=13.99>Longsleeve T-Shirt</option>
<option value=19.99>Raglan Jersey Shirt</option>
<option value=12.99>Woman's T-Shirt</option>
<option value=14.99>Jr. Capsleeve</option>
<option value=12.99>Jr. Tank Top</option>
<option value=12.99>Jr. V-Neck</option>
<option value=23.99>Hoodie</option>
<option value=16.99>Sweatshirt</option>
<option value=15.99>Trucker Hat</option>
<option value=7.99>Mousepad</option>
</select>
</div></td>
<td><div align="center">
<span class="style2">Color</span>
<select name="select_2" id="select_2" onchange="colors();">
<option>Please Select a Product</option>
</select>
</div></td>
<td><div align="center">
<span class="style2">Size</span>
<select name="select_X" id="select_X" onchange="sizes();">
<option>Please Select a Product</option>
</select>
<input type="hidden" name="rowsx" value="<?php echo $rowsx+1; ?>" />
<input name="submit" type="submit" value="Add another" />
Please please please help me, I'm going insane. The options that the user chooses need to transfer to the next page (sessions). The name and id's of the inputs need to stay the same for the JS script. If anyone needs more info please let me know.