Forum Moderators: open

Message Too Old, No Replies

passing vars to php through javascript popup window

passing vars to php through javascript popup window

         

rich413

6:45 pm on Aug 16, 2004 (gmt 0)

10+ Year Member



Help please I'm a novice and i'm going out of my mind.

I have a html form and i want to submit the data to a php script that will run in a popup window. In need to carry the data and have tried:

<script type="text/javascript" language="JavaScript">
<!--
function DoThis12() {
window.open("index_quote_result.php?<?php echo $post php?>&<?php echo $code php?>&<?php echo $unit_size php?>","","height=400,width=500,scrollbars=yes,resizable=yes,statusbar=yes,menubar=yes,toolbar=yes,dependent=yes")
}
--></script>

<form method="POST" action="Javascript:DoThis12()" >

It won't carry the data. what's wrong?

Thanks for any help...

Gul_Dukat

7:13 pm on Aug 16, 2004 (gmt 0)

10+ Year Member



Hi rich413,

try this way


<script type="text/javascript" language="JavaScript">
<!--
function DoThis12() {
var myW = window.open("","myW","height=400,width=500,scrollbars=yes,resizable=yes,statusbar=yes,menubar=yes,toolbar=yes,dependent=yes")
}
-->
</script>

And in your form tag


<form method="POST" action="index_quote_result.php?<?php echo $post php?>&<?php echo $code php?>&<?php echo $unit_size php?>" onsubmit="DoThis12()" target="myW" >

RonPK

9:05 pm on Aug 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello & welcome rich413,

What data are you trying to pass to the popup: data entered in the form on the opening page, or some other data?

rich413

9:21 pm on Aug 16, 2004 (gmt 0)

10+ Year Member



Thanks for the interest but Gul_Dukat's suggestion above worker like a charm.
thanks again,
rich