Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 field validation

 
Ramkumar Subburaj
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I want to validate two password fields in change password m and I have the following in my validation.xml



and in my JSP page source, i get the following Java Script validation code



As youi can see, the Java script validation is not what I except. It is checking only if the field exists and not performing the comparison

Is there anything I am missing

Thanks

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ramkumar Subburaj wrote:Is there anything I am missing

Yes:

http://struts.apache.org/2.x/docs/pure-javascript-client-side-validation.html
 
Ramkumar Subburaj
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.

If I'm not wrong, "fieldexpression" can not be used for client side validation.

If that is the case, is there any way of achieving it or should we go for handwritten java script.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic