File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "validation " Watch "validation " New topic
Author

validation

Kathi Sierra
Greenhorn

Joined: May 17, 2005
Posts: 2
Hi.....

i want to make sure that the user entered text should only capital letters.


This is my validation.xml.
what changes i need to make.

<field property="id" depends="required">
<msg name="mask" key="errors.lastname"/>
<arg0 name="required" key="id.required"/>
<var>
<var-name>mask</var-name>
<var-value>^[A-Z]*$</var-value>
</var>
</field>

Thanks.
Mallika R Kumar
Ranch Hand

Joined: Jan 21, 2004
Posts: 38
Hi,
depends should have "required,mask" for the mask rule to be called. The declaration you have is only for "required" rule. Even though you have defined mask rule, you haven't connected your field to the rule. depend attribute does that, so you need to specify "mask" in the depends attribute.

Mallika.
Kathi Sierra
Greenhorn

Joined: May 17, 2005
Posts: 2
Thanks....it works
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
"Kathi Sierra",

Welcome to JavaRanch. We don't have many rules here, but we do have a naming policy which we try to strictly enforce. Please re-read this document and edit your display name in order to comply. Your display name appears to fall into the "obviously fictitious" category and seems to be a play on respected author and JavaRanch staffer Kathy Sierra. Thanks in advance, and we look forward to seeing you around the Ranch.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: validation
 
Similar Threads
Struts validator Framework
Validating password field
Using masks in Validations
mask validation not working
validation