Opening new windows and doPost
1 posts in topic
Flat View  Flat View

Posted By:   Edgar_Martinez
Posted On:   Thursday, March 29, 2001 03:02 PM

How can I create a new window that gets its parameters via doPost using javaScript. The only way I know to do that is using "window.open(url)" but with this way you must to send your parameters in the url, and get them via doGet.

Re: Opening new windows and doPost

Posted By:   Dave_Eaves  
Posted On:   Thursday, March 29, 2001 04:06 PM

The way that I've done this in the past is by creating a form on the html page that has a target the same as the window name that you're going to open. You can then write an openPostWindow function to be called on submit (this way you can specify a size and other attributes for your new window). I will attempt to provide an example below. Please note that I'm providing it without having tested this example first.

function openPostWindow()


// Note you have to point at some intermediary page first when the form posts the location of the new window will be replaced by your form's action.



I don't want the HTML to get messed up so I will just explain what the attributes of your form should be





If this doesn't work right try using an onclick on the submit button to launch the window prior to the form submitting, or optionally you can call the javascript function onclick of a button and call
after opening the window.

Hope this helps!

About | Sitemap | Contact