aspose file tools*
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
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: onload function required for multiple tiles in a single form