This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes onload function required for multiple tiles in a single form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "onload function required for multiple tiles in a single form" Watch "onload function required for multiple tiles in a single form" New topic
Author

onload function required for multiple tiles in a single form

eric he
Greenhorn

Joined: Mar 15, 2005
Posts: 6
I have multiple tiles, each of them requires enable/disable some controls when the form is initially loaded, they are used together inside a single form of a generic layout jsp, which I can't modify, anybody knows how to make it work?

Thanks in advance.

Eric
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Just put the enable/disable code in a <script></script> tag set at the bottom of your HTML in each page. I'm not talking about writing a function, I'm talking about just writing lines of JavaScript code that will run when the page is rendered. This will have the same effect as having it executed by the body's onload event.


Merrill
Consultant, Sima Solutions
eric he
Greenhorn

Joined: Mar 15, 2005
Posts: 6
Thanks Merrill, your suggestion worked, it seems have the same effect as putting a function call inside form.onload.

Eric
eric he
Greenhorn

Joined: Mar 15, 2005
Posts: 6
more interesting question would be, what if I want to do something on form.reset, suppose I know the form.onreset for the layout is empty, and I have resetTile1, resetTile2 on two different tiles, is there any javascript solution to do that without changing the layout? this should be a common tiles question.

Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: onload function required for multiple tiles in a single form
 
Similar Threads
onload functions required in multiple tiles
forms and tiles
Struts modules and html:form
multiple forms
Tiles Multiform submit