I have a form to a shopping cart that I am developing, that adds a product to the cart using standard HTML forms. To give some feedback I open a popup window using onsubmit, and opening a new window on top with the following code
Code:
function display_alert(p,c)
{
var h=260;
var w=380;
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var targetWin = window.open("./alert.php?prod="+p+"&coll="+c, "_blank", "location=no, status=no, toolbar=no, menubar=no, directories=no, width="+w+", height="+h+", top="+top+", left="+left);
}
Variable P is the product ID, and C is the collection (category) ID.
I also want to pass the quantity of products ordered to this function, HOWEVER the quantity is an HTML text box within the same form, called as so:
Code:
<input type="text" name="cart_quantity" value="0" maxlength="6" size="4" />
I have tried to use the PhP $_POST to read the data from the form, but it won't read the data - presumably as I am not directly submitting the data from the form to the alert.php file.
So the question is: how can I get this cart_quantity variable either into the URL data or passed to the alert.php file?
Any help would be appreciated.