• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

submitting two forms at a time

 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.....
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
What's a year in metric? Do you know this metric stuff tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic