replaced mine with this one now :) thanks
small typos:
from gluon.validators import Validator
def __init__(self,error_message='invalid!'):
On Wed, Sep 26, 2012 at 3:25 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
Yes.
you can do:
import re
from gluon.validator import
don't be sorry for jumping in it is appreciated ! .. and refreshing to
noticed that there are canadian folks like me on here !
to resume ... from all the responses received - the best canadian postal
code validation is actually the one submitted by Adnan :
this one :
You can may use .capitalize() before the vars get validated by validators.
I thought that there was a way to do action before the form get validated,
but I can't find in the book, something like beforevalidation, instead of
onvalidation that is provided.
I think that if beforevalidation doesn't
Yes.
you can do:
import re
from gluon.validator import Validator
class CANADIAN_ZIP(Validator):
regex = re.compile('^[ABCEGHJKLMNPRSTVXY]{1}\d{1}[A-Z]{1}
*\d{1}[A-Z]{1}\d{1}$')
def __init__(self,error_message='invalid!):
self.error_message = error_message
def
:)
Richard
On Wed, Sep 26, 2012 at 3:25 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
Yes.
you can do:
import re
from gluon.validator import Validator
class CANADIAN_ZIP(Validator):
regex = re.compile('^[ABCEGHJKLMNPRSTVXY]{1}\d{1}**[A-Z]{1}
*\d{1}[A-Z]{1}\d{1}$')
thank you guys ... so the set of characters only ( exclusively ) need to
be referred to as : [A-Za-z]
perfect ... thank you again.
--
On 09/25/2012 04:08 PM, Le Don X wrote:
thank you guys ... so the set of characters only ( exclusively ) need
to be referred to as : [A-Za-z]
Sorry for jumping in, I'm just seeing this thread for the first time.
Keep in mind the following other rules, just in case you're trying to
validate
requires = IS_MATCH('^[A-Z]\d[A-Z][\- ]?\d[A-Z]\d$',error_message='not a
zip code')
On Monday, 24 September 2012 20:13:03 UTC-5, Don_X wrote:
Hello web2py users :
Validating if numbers or decimals are entered on a form seem to be very
straight forward and easy enough ! whether it is a
8 matches
Mail list logo