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'

http://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit 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");
                form.appendChild(hiddenField);
                document.body.appendChild(form);    // Not entirely sure if this is necessary           
                form.submit();


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:

onclick=window.open(test.html,'','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,status=no');

    

asked Oct 19, 2015 by amit.gupta
0 votes
1 view



Related Hot Questions

4 Answers

0 votes
NULL
answered Oct 19, 2015 by vijaygupta1980
0 votes
NULL
answered Oct 19, 2015 by patilkiran.101
0 votes
NULL
answered Oct 19, 2015 by r3tt
0 votes
NULL
answered Oct 19, 2015 by badhwar.rohit

...