PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
shiznatix
DevNet Master
Posts: 2745 Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:
Post
by shiznatix » Thu Mar 24, 2005 12:17 am
i am trying to open a new window on hitting submit but with passing variables with the form that has the submit button. i believe this would consist of javascipt with some php maybe but how would i submit the varialbes in the form with the outside javascript. here is the code i have now.
Code: Select all
<SCRIPT LANGUAGE="e;javascript"e;>
<!--
window.open ('view_cart.php?action.php?action=add_item', 'newwindow', config='height=100,
width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no,
location=no, directories=no, status=no')
-->
</SCRIPT>
<form action="e;view_cart.php?action=add_item"e; method="e;post"e;>
<img src="e;img/Stencils/mazdaspeedstencils.jpg"e; width="e;491"e; height="e;45"e;><br>
Price: $2.50<br>
<input type="e;hidden"e; name="e;itemName"e; value="e;MazdaSpeed Caliper Decal/Stencil"e;>
<input type="e;hidden"e; name="e;itemPrice"e; value="e;2.50"e;>
<input type="e;submit"e; name="e;submit"e; value="e;Add To Cart"e; onClick="e;window.open();"e;>
</form>
but this dosnt work.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Mar 24, 2005 12:30 am
you can...
iterate through the form on submission request creating a url with get data, then call the popup. generate the popup on submission, then pass the data to a waiting script on that page. choose to not use a popup
shiznatix
DevNet Master
Posts: 2745 Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:
Post
by shiznatix » Thu Mar 24, 2005 12:36 am
a. (no idea how to do that)
b. (how would i make the popup come up before i passed the data)
c. (not a option
)
im confused as to how to do these things
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Mar 24, 2005 12:53 am
well..
the code you posted thus far will immediately try to create a popup...
open() returns a window object. You can send data through it..
shiznatix
DevNet Master
Posts: 2745 Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:
Post
by shiznatix » Thu Mar 24, 2005 10:17 am
ahhh thanks feyd i got it. if anyone has the same problem open a blank window with
onclick="window.open('', 'windowName');" then have the form target as windowName