aspose file tools*
The moose likes Struts and the fly likes Struts 2 field validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 field validation" Watch "Struts 2 field validation" New topic
Author

Struts 2 field validation

Ramkumar Subburaj
Ranch Hand

Joined: Sep 07, 2007
Posts: 83
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


SCJP 1.5, SCWCD 1.4.
Hanging between Web Services and EJB
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Sep 07, 2007
Posts: 83
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.
 
 
subject: Struts 2 field validation