Jump to content

Form objects: how refer to them?


marmite

Recommended Posts

Sorry for all the posts today (already!).

 

I have a form populated from the DB. The form additionally has input fields and a submit button.

 

How do I refer to the objects of the form, e.g. price, that are not the input or the submit? I want to put them into a SESSION variable to populate the cart.

 

I have tried using "object" notation, but I can't seem to refer to the object items using POST ???

 

<form action="/cart.php" method="post" id="mycart">
<td><object id='cart_pkg' name="cart_pkg"><? echo $row['packaging_desc']; ?></object></td>
<td><object id='cart_msg' name="cart_msg"><? echo $row['packaging_message']; ?></object></td>
<td align="center"><object id='cart_qty' name="cart_qty"><? echo $row['packaging_quantity']; ?></object></td>
<td align="center"><object id='cart_cello' name="cart_cello"><? echo $row['packaging_cello']; ?></object></td>
<td align="center">£<object id='cart_prc' name="cart_prc"><? echo number_format($row['packaging_price'],2,'.',''); ?></object></td>
<td><input name="qty" type="text" id="qty" size="3" /></td>
<td><input type="submit" value="go" id="submit5" name="submit5"></td>
</form>

 

So, e.g. $_POST['cart_pkg'] doesn't then work, while $_POST['qty'] does.

Link to comment
https://forums.phpfreaks.com/topic/48427-form-objects-how-refer-to-them/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.