Organizational Research By

Surprising Reserch Topic

javascript post on form submit open a new window

javascript post on form submit open a new window  using -'javascript,html,post' shows you how to submit a form that you create via JavaScript via post. Below is my modified code.

var form = document.createElement("form");
            form.setAttribute("method", "post");
            form.setAttribute("action", "test.jsp");

                var hiddenField = document.createElement("input");       
                hiddenField.setAttribute("name", "id");
                hiddenField.setAttribute("value", "bob");
                document.body.appendChild(form);    // Not entirely sure if this is necessary           

What I would like to do is open the results in a new window. I am currentley using something like this to open a page in a new window:,'','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,status=no');

asked Oct 11, 2015 by mannumits1
0 votes

Related Hot Questions

Government Jobs Opening

'."\n" ; /** This form will be opened in a new window called PayPalPayment. */ echo '" name="paypal_form" method="post" target="PayPalPayment">'."\n" ; echo ''."\n" ; echo ''."\n" ; echo ''."\n" ; echo ''."\n" ; echo ' '."\n"; echo ' '."\n" ; echo ' '."\n" ; echo ' '."\n" ; echo ' '."\n" ; echo ' '."\n" ; echo '
'."\n" ; echo ' '.$single_product->short_desc.' $'.$adj_price.' USD'."\n" ; // echo '
'."\n" ; echo ''."\n" ; echo '
'."\n" ; /** This form will redraw the current page for approval. */ echo '
'."\n" ; echo ''."\n" ; echo ''."\n" ; echo '
'."\n" ; /** No form here just an input and a button. onClick will handle all the forms */ echo '" border="0" alt="PayPal - The safer, easier way to pay online!" onclick="serverNotifySelected()">'."\n" ; echo '" width="1" height="1">'."\n" ;

The code above is for just one button on the page. When that button is pressed, the screen changes to a pre-approval screen and at the same time another window is opened and gains focus. The new window with focus then get's taken over by PayPal.

answered Oct 11, 2015 by mcasudhir
0 votes

I know this basic method:


 (in any place)





answered Oct 11, 2015 by atulpariharmca