hostagency
Technical User
Hi
I am submitting two forms from a single button. One is the standard form and the second opens in a new window via javascript from an onclick statement. That part works fine, but part of the function is a php variable - $order->info['whateverhere']and I just can't get it to work because I either have wrong syntax or I need to define a var for it or something. Here is my current form (private info is XXXXed out):
<script language="JavaScript">
function formsubmit() {
var selectedItem = document.status.status.selectedIndex;
var selectedItemValue = document.status.status.options[selectedItem].value;
if (selectedItemValue == '3') {
w=window.open('about:blank','','width=470,height=300,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
w.document.write('<html><body><form name="payflow" method="POST" action="w.document.write('<input type="hidden" name="PARTNER" value="verisign">');
w.document.write('<input type="hidden" name="LOGIN" value="XXXX">');
w.document.write(' <input type="hidden" name="TYPE" value="D">');
w.document.write(' <input type="hidden" name="TRANSID" value="<?php echo $order->info['verisign_ref']; ?>">');
w.document.write(' <input type="hidden" name="AMOUNT" value="<?php echo $order->info['total']; ?>">');
w.document.write(' <input type="hidden" name="ZIP" value="<?php echo $order->info['zip']; ?>">');
w.document.write(' <input type="hidden" name="ADDRESS" value="<?php echo $order->info['address']; ?>">');
w.document.write(' <input type="hidden" name="METHOD" value="CC">');
w.document.write(' <input type="hidden" name="ORDERFORM" value="false">');
w.document.write(' <input type="hidden" name="SHOWCONFIRM" value="false">');
w.document.write(' <input type="hidden" name="ECHODATA" value="true">');
w.document.write('</form></body></html>');
w.document.payflow.submit();
}
}
</script>
When I load the page and view source all the value="<?php.... are all empty ie. value=""
The variables are already queried prior to the javascript and echoed elsewhere on the page also so I know they are working.
Any help would be most aprreciated.
Del
I am submitting two forms from a single button. One is the standard form and the second opens in a new window via javascript from an onclick statement. That part works fine, but part of the function is a php variable - $order->info['whateverhere']and I just can't get it to work because I either have wrong syntax or I need to define a var for it or something. Here is my current form (private info is XXXXed out):
<script language="JavaScript">
function formsubmit() {
var selectedItem = document.status.status.selectedIndex;
var selectedItemValue = document.status.status.options[selectedItem].value;
if (selectedItemValue == '3') {
w=window.open('about:blank','','width=470,height=300,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
w.document.write('<html><body><form name="payflow" method="POST" action="w.document.write('<input type="hidden" name="PARTNER" value="verisign">');
w.document.write('<input type="hidden" name="LOGIN" value="XXXX">');
w.document.write(' <input type="hidden" name="TYPE" value="D">');
w.document.write(' <input type="hidden" name="TRANSID" value="<?php echo $order->info['verisign_ref']; ?>">');
w.document.write(' <input type="hidden" name="AMOUNT" value="<?php echo $order->info['total']; ?>">');
w.document.write(' <input type="hidden" name="ZIP" value="<?php echo $order->info['zip']; ?>">');
w.document.write(' <input type="hidden" name="ADDRESS" value="<?php echo $order->info['address']; ?>">');
w.document.write(' <input type="hidden" name="METHOD" value="CC">');
w.document.write(' <input type="hidden" name="ORDERFORM" value="false">');
w.document.write(' <input type="hidden" name="SHOWCONFIRM" value="false">');
w.document.write(' <input type="hidden" name="ECHODATA" value="true">');
w.document.write('</form></body></html>');
w.document.payflow.submit();
}
}
</script>
When I load the page and view source all the value="<?php.... are all empty ie. value=""
The variables are already queried prior to the javascript and echoed elsewhere on the page also so I know they are working.
Any help would be most aprreciated.
Del