I have a form, and what I'm trying to do is post info to the form using
<form method="post" action="ShoppingCart.php">
and a submit button. I also want to have the window close and return the user to the original parent window (the form is in a popup.)
I've tried
onclick="window.opener.location.href='ShoppingCart.php'; window.close();"
and the problem seems to be that assigning all three actions to the button, sometimes it posts to the form first and then closes and returns, and sometimes it does not (sometimes it closes and returns without posting to the cart.)
I also tried onRelease, but nothing happened. Here's what my code looks like now, can anyone help me out?
<form method="post" action="ShoppingCart.php" onclick="window.opener.location.href='ShoppingCart.php'; window.close();">
[item description]
<input type="submit" name="Submit" value="Add To Cart" / >
</form>
<form method="post" action="ShoppingCart.php">
and a submit button. I also want to have the window close and return the user to the original parent window (the form is in a popup.)
I've tried
onclick="window.opener.location.href='ShoppingCart.php'; window.close();"
and the problem seems to be that assigning all three actions to the button, sometimes it posts to the form first and then closes and returns, and sometimes it does not (sometimes it closes and returns without posting to the cart.)
I also tried onRelease, but nothing happened. Here's what my code looks like now, can anyone help me out?
<form method="post" action="ShoppingCart.php" onclick="window.opener.location.href='ShoppingCart.php'; window.close();">
[item description]
<input type="submit" name="Submit" value="Add To Cart" / >
</form>