[eluser]Matalina[/eluser]
I don't know why its happening. Here's the code, I'll explain the problem after that:
View Code:
Code:
<h2>Order Form</h2>
<?php
if(!empty($order)) {
?>
<?php
$id = 0;
foreach($order as $vendor => $item) {
?>
<table>
<tr>
<th colspan="4"><?php echo $vendor;?></th>
</tr>
<?php
foreach($item as $store => $row1) {
?>
<tr>
<th colspan="4">Store #<?php echo $store;?></th>
</tr>
<tr>
<th>Qty</th>
<th>Item</th>
<th>Price</th>
<th>SubTotal</th>
</tr>
<?php
foreach($row1 as $row) {
$id++;
?>
<tr>
<td><?php echo form_input('order'.$id,set_value('order'.$id,1),'size="3" maxlength="3" class="order"').form_hidden('price'.$id,$row['StandardCost'],'class="price"');?></td>
<td><?php echo $row['BrandName'].' '.$row['ModelNumber'].'<br/>'.$row['ModelDescription'];?></td>
<td><?php echo '$'.number_format($row['StandardCost'],2);?></td>
<td class="subtotal"><?php echo '$'.number_format($row['StandardCost'],2);?></td>
</tr>
<?php
}
}
?>
</table>
<?php
}
?>
<?php
}
else {
?>
<div class="alert-box warning">There is nothing to order at this time.</div>
<?php
}
?>
Actual HTML output for second row:
Code:
<td><input type="text" name="order2" value="1" size="3" maxlength="3" class="order"><input type="hidden" name="price1" value="237">
<input type="hidden" name="price2" value="264">
</td>
I should only have one hidden input. I don't have two text inputs, so I'm at a lost of why the hidden field is getting added twice. Note: The third row will display 3 hidden fields.