Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hwo to add javascript code in validator-rules

 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Mani Venkata Kanth
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic