Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1794
  • Last Modified:

Struts : How to open a action in new window

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
LakshmanaRavula
Asked:
LakshmanaRavula
  • 2
  • 2
  • 2
3 Solutions
 
PaulioCommented:
<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
 
LakshmanaRavulaAuthor Commented:
Hi

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

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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
PaulioCommented:
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
 
thirdCommented:

<form action="somepage.cgi" targer="_new">
0
 
thirdCommented:
err, "targer" should be "target"
0

Featured Post

Technology Partners: 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!

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now