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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.