posted 22 years ago
This should work for your first question. I use it frequently.
function doWindow() {
someWin = window.open("","win1","width=780,height=520,scrollbars=yes,resizable=yes,menubar=no,statusbar=yes");
document.printForm.submit();
}
....
<form name="printForm" action="something.html" target="win1" method="post">
<input type="text" name="text1" value="">
<input type="button value="Click me!" onClick="doWindow()">
</form>
When the button is pressed it will open the new window and then call the submit method of the form and the form will submit to the new opened window based on the target attribute.