/    Sign up×
Community /Pin to ProfileBookmark

Submit the form in a new window

Hi Friends,

I wanted to submit the form through javascript. I have the code like

document.forms[0].action = “download.do”;
document.forms[0].method = “post”;
document.forms[0].submit();
Actually this form will submit and response comes in a same window.

But I wanted to get the response in a new window. This should do in javascript only.
we have tried like this
window.open(“download.do”,”name”,”height=400,width=400″);
I think here I am not submitting the form, so I am not able to get the values from form.

Please help with proper coding…

Thanks in advance..

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@KorNov 12.2007 — You may set the form's target.

Try:
<i>
</i>document.forms[0].action = "download.do";
document.forms[0].method = "post";
[COLOR="Blue"]document.forms[0].target="_blank";[/COLOR]
document.forms[0].submit();
Copy linkTweet thisAlerts:
@tlnprasadauthorNov 14.2007 — Kor,

Thank you for answer, It is working fine but the problem is I have 4 links in the screen , If I click this function, I think form is taking the target as new window. So If I click any another links navigation is going to new window always. Is there any other way to get new window. Or can we do something over here...

Let me know the proper code.


Thanks in advace...
×

Success!

Help @tlnprasad spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...