This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Struts and the fly likes Moving static JavaScript validations into separate file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Moving static JavaScript validations into separate file" Watch "Moving static JavaScript validations into separate file" New topic
Author

Moving static JavaScript validations into separate file

Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 171
I really suspect that moving static JavaScript validations into separate file really works in Struts? I've spent two nights trying to do that and failed. Is there any REAL WORKING EXAMPLE!!! I would like to see it!!!
Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 171
No idea???
Liju Cherian
Ranch Hand

Joined: Mar 17, 2006
Posts: 44
Take a look at the example below:

dcmsscripts.js -


visitation_othercustody.jsp -


Hope the above example gives you an idea how to implement static javascript validations within a separate .js file; such that it could be re-used over multiple .jsp pages.


Cheers,
Liju

PS- Parameter "on keypress" within the <html:text/> tag is actually one word.
[ April 13, 2006: Message edited by: Liju Cherian ]

"What's in a name? That which we call a rose by any other name would smell just as sweet."<br />(William Shakespeare, Romeo and Juliet, Act II, Scene II)
Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 171
No, I don't want that!!!

In fact I have an example from the book, saying I should use dynamicJavascript and staticJavascript parameters of the html:javascript tag, but it doesn't work? I have found very simillar examples on the web, probbably transcribed from the books, but they doesn't work.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Moving static JavaScript validations into separate file
 
Similar Threads
Moving javascript with scriptlets to a separate file
Disable refreshing a page when browser window is resied or iconized
Validation rule for array of objects.
calling java class file from javascript
Regarding validations part of Struts...