Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

submitting 1 form but 2 targets

 
nitin singh
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I have a situation like.I have a form and 2 buttons.Onclick of first button the form should get submitted and result should come in same page.On the click of other button the form should get submitted but the result page should come in a new popup,parent window still open.
Any solution

<html:form action="fetchReportXls.do" method="post" target="_new">
I say this a new window comes.

for other button I call this but this will not work.Any suggestions ?

function viewForm(){
document.forms[0].action="fetchReport.do?document=<bean:writename="BusinessObjectActionForm" property="documentName"></bean:write>";
document.forms[0].submit();
}
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can manipulate the target with JavaScript. My advice would be to code the <html:form> tag without a target attribute and then put the logic to change the target in your JavaScript code.

For example, the JavaScript code:

document.forms[0].target = "_blank";

will cause the next form to be displayed in a new window while

document.forms[0].target = "_self";

will cause it to be displayed in the same window.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic