• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Validation FrameWork Question

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anyone know how to run more than one mask on the same field (without having to write a custom validator). For example, I have a requirement that says the zip code must be five digits and can not be sequential numbers like 11111 or 99999. Can I do somthing like this:

<form name="xxxForm">
<field property="zip" depends="required,mask">
<arg key="xxx.zip" />
<var>
<var-name>mask</var-name>
<var-value>^\d{5}$</var-value>
</var>
</field>
<field property="zip" depends="required,mask">
<arg key="xxx.zip" />
<var>
<var-name>mask</var-name>
<var-value>^[^11111|22222|33333|44444|99999}$</var-value>
</var>
</field>
</form>
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The validation framework does allow you to use your own validation utility methods. It might be a good idea to use one here.

Simply add an entry to the validator-rules.xml file.
reply
    Bookmark Topic Watch Topic
  • New Topic