I saw thread216-528760 which is identical to what I am trying to do but have had no success with with the code there or my own.
This needs to be somewhat versitile so that it can be used on a "Print Page" feature and a couple others on the site, so I am trying to pass into a function the height, width, scrolling boolean and, if necessary, the url:
The HTML, which is actually generated from a PHP page, has this:
I wasn't sure if the onsubmit() was to be in the form tag or in the submit button/image tag. In all honesty, I do not know JavaScript very well so can anyone help me sort this out so that it works?
Don
Experienced in HTML, Perl, PHP, VBScript, PWS, IIS and Apache and MS-Access, MS-SQL, MySQL databases
This needs to be somewhat versitile so that it can be used on a "Print Page" feature and a couple others on the site, so I am trying to pass into a function the height, width, scrolling boolean and, if necessary, the url:
Code:
function newWindow(w, h, scroll, window, url) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = '+url+', '+window+', 'toolbar=no, location=no, directories=no, status=no, menubar=no, height='+h+', width='+w+', top='+wint+', left='+winl+', scrollbars='+scroll+', resizable=yes';
win = window.open(winprops);
if (parseInt(navigator.appVersion) >= 4) {
win.window.focus();
}
}
The HTML, which is actually generated from a PHP page, has this:
Code:
<form target='paypal' action='[URL unfurl="true"]https://www.paypal.com/cgi-bin/webscr'[/URL] method='post'>
<input type='hidden' name='cmd' value='_cart'>
<input type='hidden' name='business' value='myemail@mysite.com'>
<input type='hidden' name='item_name' value='myitem'>
<input type='hidden' name='item_number' value='7B'>
<input type='hidden' name='amount' value='50'>
<input type='hidden' name='currency_code' value='USD'>
<input type='image' src='[URL unfurl="true"]https://www.paypal.com/images/x-click-but22.gif'[/URL] border='0' name='submit' onsubmit='newWindow('600','450','yes','paypal','')';>
<input type='hidden' name='add' value='1'>
</form>
I wasn't sure if the onsubmit() was to be in the form tag or in the submit button/image tag. In all honesty, I do not know JavaScript very well so can anyone help me sort this out so that it works?
Don
Experienced in HTML, Perl, PHP, VBScript, PWS, IIS and Apache and MS-Access, MS-SQL, MySQL databases