• 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

Nested Form problem with IE. How to avoid using struts?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all java gurus,

My JSP:




Here I have a collection of keywords, and printing them in a loop with submit buttons and the user can delete whatever the keyword they like. (action will remove the corresponding entry from the ArrayList). Also the user can add a keyword to the collection using another submit button. (adding a new entry to arraylist)

The problem is this code segment don't work in IE, and later I found out that the sitemesh in my program is adding another fom element to the JSP. I googled and found out that the nested forms are not working in IE. (and it is not recommended?)

I tried to fix this by removing my form tag, but my keyword removal function failed (the action can't distinguish which keyword is to be removed). only the adding keyword was working.

I tried it using javascript but I couldn't find a way to get the remove-button index the user presses. (because keywords are rendered dynamically)


Am I doing something wrong? I'm not much familiar with using JSPs. Please help me!!!

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi use form outside inner form

like

use this way

 
DimuthuDeeJay Jayamanna
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply.

But my sitemesh configuration added a <form> tag to the upper section and closes it at the lower. (its a header and footer)
So I dont have a control over it
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then you had better change the SiteMesh configuration, hadn't you? It's a weird design to use a library like SiteMesh for opening/closing form tags anyway, and even more so to do it in the page header/footer.
 
DimuthuDeeJay Jayamanna
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulf Dittmer,

I agree with you.
However I looked through the sitemesh configurations and the include pages and couldnt find any form tags inside the header and footer. But after I render the page, it appears in the JSP (page->view source)

Apart from that, I'm not sure about the consequences of changing since so many share the same config.
Thats why I tried to change my JSP.

 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd advise not to change anything until (and unless) you fully understand which parts of the final HTML originate from which JSP pages or page fragments, in whichever way they may be included.
 
DimuthuDeeJay Jayamanna
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
solved it like this. I wonder why struts submit buttons passes parameters incorrectly.

reply
    Bookmark Topic Watch Topic
  • New Topic