whirlpool6 Posted August 7, 2007 Share Posted August 7, 2007 guys, i need suggestions in here. i want to open a new window with a click of a button. but i want to set parameters in this new window using post. i dont want to get the parameters from the url. what is the best way to do this guys? thanks a lot. Quote Link to comment Share on other sites More sharing options...
gurroa Posted August 9, 2007 Share Posted August 9, 2007 Just prepare form with hidden fields and submit it just after opening new window. You just have to set the same target as is the new window's name. <html> <script> function OpenNewWindow() { window.open('about:blank', 'NewWindow', '...'); } </script> <body> <form name="MyHiddenForm" method="post" action="test3.php" target="NewWindow"> <input type="hidden" name="var1" value="val..."> <input type="hidden" name="var2" value="val..."> </form> <button type="button" onclick="OpenNewWindow(); document.MyHiddenForm.submit();">Open new window</button> </body> </html> Quote Link to comment Share on other sites More sharing options...
whirlpool6 Posted August 15, 2007 Author Share Posted August 15, 2007 thanks a lot... this really helped me.... and now its solved... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.