Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Struts : How to open a action in new window

Posted on 2004-04-12
7
Medium Priority
?
1,744 Views
Last Modified: 2012-05-04
Hi

When i submit my form  depends on action i have to open a new window,  How can i take care this in Action Class

0
Comment
Question by:LakshmanaRavula
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
7 Comments
 
LVL 1

Assisted Solution

by:Paulio
Paulio earned 400 total points
ID: 10807277
<script>
function make_target(form_ref){
  var target_win = window.open('', 'newwin', 'width=400,height=400');
  form_ref.target = target_win;
}
</script>
<form action="" onSubmit="make_target(this)">
  <input blabla>
</form>

hope it helps!
0
 

Author Comment

by:LakshmanaRavula
ID: 10807326
Hi

I haqve tried using this option But Result coming into parent window and new window coming with no data
0
 

Author Comment

by:LakshmanaRavula
ID: 10807337

On Parent window i have 6 actions,  out of 6 one of the action should print report on new window so iam calling a javascript that contins new window for that Submit button  

New window coming with blank and report coming on parent window`
0
AWS Certified Solutions Architect - Associate

This course has been developed to provide you with the requisite knowledge to not only pass the AWS CSA certification exam but also gain the hands-on experience required to become a qualified AWS Solutions architect working in a real-world environment.

 
LVL 1

Assisted Solution

by:Paulio
Paulio earned 400 total points
ID: 10808216
Oops...

The correct code to submit a form in a new (popup) window should have been:

<script>
function make_target(form_ref){
  window.open('', 'newwin', 'width=400,height=400');
  form_ref.target = 'newwin';
}
</script>
<form action="somepage.cgi" onSubmit="make_target(this)">
  <input type=text name=test value="" size=20>
  <input type=submit>
</form>

If you are actually looking for another solution, could you please post the relevant code?
0
 
LVL 30

Accepted Solution

by:
third earned 200 total points
ID: 10809777

<form action="somepage.cgi" targer="_new">
0
 
LVL 30

Expert Comment

by:third
ID: 10809778
err, "targer" should be "target"
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question