File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

submitting two forms at a time

 
Kalyana Sundaram
Ranch Hand
Posts: 94
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I dont know if I were idiotic to ask this question. but this is situation i am facing now. In my struts application, I have a view which when submitted creates ActionForm and handled by Action and everything was OK.

But the problem started when I was supposed to include an IFRAME in the JSP. its like
<html>
<body>
<html:form action=/settings" >
<html:checkbox property="prop1" />
<html:checkbox property="prop2 />
<html:select>
--
</html:select>
<html:form>
<iframe scrolling=yes width=100% frameborder=1 src="openAnalyzerPreferences.do" height=275 >
</body>
</html>

The JSp displayed by the IFRAME HAS its own Action form and Action classes.

So now the problem is user would be changing the properties in the outer JSP as well as the JSP displayed in IFRAME. I need to invoke the two actions for the outer JSP as wellas the one for IFRRAME

How this situation could be handled. Any workarounds possible.....
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as HTML forms are concerned, the outer frame and the Iframe are two separate pages and are submitted separately. If you want the outer form to submit changes made in the inner form, I'd suggest creating hidden fields in the outer frame corresponding to fields in the iframe. You can then use javaScript to copy the fields from the Iframe to the outer frame before you submit the form in the outer frame.

Here is a sample javaScript function:


Alternatively you could use javascript to submit the iframe form at the same time you submit the outer form, like this:

[ May 09, 2005: Message edited by: Merrill Higginson ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic