Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Struts : How to open a action in new window

Posted on 2004-04-12
7
Medium Priority
?
1,763 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
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

971 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