Re: Validation rule writing

2006-12-15 Thread Laurie Harper

What Chris said, plus this:

  there's no validation rule named 'areaCodeMask' or 'phoneMask'; you want 
just 'mask' as the rule name. See the validator documentation for examples.


Also, is validation working at all for you? For example, is it correctly 
detecting errors for the properties you have marked with just the 
'required' rule? If not, start by figuring that out, then worry about 
getting your masks applied correctly.


L.

Thom Burnett wrote:

I'm trying to validate two fields - area code and phone number (as nnn-
no areacode in that input).

Various samples and reading suggest that I should be able to create a mask
and apply it as below but my result is that the area code can't be empty 
but

it can contain letters, be longer than 3. It's ignoring my regular
expression mask.

Am I missing something simple in how to setup and use the 
validations.xml or

am I going about this in the wrong way?




 

  phoneFormatMask
  ^[0-9]{3}-[0-9]{4}$


  areaCodeFormatMask
  ^[0-9]{3}$

 
 
   
   
 

  
  

  
  

  
  

 
  
areaCodeMask
${areaCodeFormatMask}
  
  
  
 
 
   phoneMask
   ${phoneFormatMask}
 
  








-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Validation rule writing

2006-12-15 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thom,

Thom Burnett wrote:
> I'm trying to validate two fields - area code and phone number (as nnn-
> no areacode in that input).
>
> [snip]
>
>   phoneFormatMask
>   ^[0-9]{3}-[0-9]{4}$

This regexp looks good. Have you checked the docs for the regexp engine
used by the validator (is it Jakarta-ORO?) to make sure that the syntax
you are using is correct? You may have to use [0-9][0-9][0-9] instead of
[0-9]{3}, for instance.

>  
>phoneMask
>${phoneFormatMask}
>  

Have you tried putting the mask directly into the  element?
This would help you verify that your mask is working, even if your
configuration isn't 100% correct (i.e. the use of the 'constant' fields
might not be working).

Hope that helps,
- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFgtQE9CaO5/Lv0PARAu/yAKCMR7YwcuX+BBQ+/D7DX/e04dS+0QCeLlSz
9/TG4qqBX7xgXJW8YKPKX68=
=L1kC
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Validation rule writing

2006-12-15 Thread Thom Burnett

I'm trying to validate two fields - area code and phone number (as nnn-
no areacode in that input).

Various samples and reading suggest that I should be able to create a mask
and apply it as below but my result is that the area code can't be empty but
it can contain letters, be longer than 3. It's ignoring my regular
expression mask.

Am I missing something simple in how to setup and use the validations.xml or
am I going about this in the wrong way?




 

  phoneFormatMask
  ^[0-9]{3}-[0-9]{4}$


  areaCodeFormatMask
  ^[0-9]{3}$

 
 
   
   
 

  
  

  
  

  
  

 
  
areaCodeMask
${areaCodeFormatMask}
  
  
  
 
 
   phoneMask
   ${phoneFormatMask}
 
  
...