• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

validation

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks....it works
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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.
 
Onion rings are vegetable donuts. Taste this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!