jQuery in Action, 2nd edition*
The moose likes Struts and the fly likes hwo to add javascript code in validator-rules Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "hwo to add javascript code in validator-rules" Watch "hwo to add javascript code in validator-rules" New topic
Author

hwo to add javascript code in validator-rules

saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
i am little bit poor in writing java script for writing the validations in validator-rules.xml file
and more over i need to validate at client side
so is there any thing for generating java script in validator-rules.xml?


please somebody help me is ther way to add javascript code for these kind of validations


A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
Mani Venkata Kanth
Ranch Hand

Joined: Aug 21, 2006
Posts: 39
hi
there is a tag html:javascript in struts-html.tld for enable java script validations in your web page.

no need to write anything in validation-rules.xml

just place this statement in your jsp page:
<html:javascript formName="return loginForm.validate()"/>

if your form name is loginForm in config file.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: hwo to add javascript code in validator-rules