Well, by now I have tested the heck out of this thing, and the ill behavior
has gone away and I can't get it to come back.....

My natural curiosity wants to know why but, in any case, good riddance!






On Tue, Sep 17, 2013 at 4:12 PM, REM <[email protected]> wrote:

> In  further exploration, there's some inconsistencies in behavior.
> Sometimes it triggers the error and sometimes it doesn't. I haven't yet
> figured out what the determining factor is.
>
>
>
> On Tuesday, September 17, 2013 4:02:53 PM UTC-4, REM wrote:
>>
>> Actually, in checking out this solution, there is no change. It 
>> *still*always triggers the validator.
>>
>> What could be causing this?
>>
>>
>>
>> On Tuesday, September 17, 2013 2:56:16 PM UTC-4, Anthony wrote:
>>>
>>> requires=IS_EMPTY_OR([IS_**LENGTH(maxsize=200),
>>>                      IS_MATCH('^[a-zA-Z0-9\s\#\.\$**\-\_]+$',error_message
>>> ='Character Not Allowed.')])
>>>
>>>
>>> Anthony
>>>
>>> On Tuesday, September 17, 2013 2:44:14 PM UTC-4, REM wrote:
>>>>
>>>> I have a form field which is not required, but when it is submitted
>>>> with data, I want the data to be validated. The problem is, I get the
>>>> validator triggering when the form is submitted with no value in that
>>>> field. I want it to wait until there's data in there to validate it and
>>>> ignore it if blank. I thought I could get this behavior with required=False
>>>> and then using requires= validators, but it is failing the validation every
>>>> time when there's no data in the field. How do you get it to validate data
>>>> that's present and ignore blanks?
>>>>
>>>> The field in question is in the db.py as follows:
>>>>
>>>>     Field('special_code1', 'string', length=200, required=False, 
>>>> label='Special
>>>> Code 1',
>>>>            requires=[IS_LENGTH(maxsize=2**00),
>>>>                      IS_MATCH('^[a-zA-Z0-9\s\#\.\$**\-\_]+$',error_message
>>>> ='Character Not Allowed.')]
>>>>          ),
>>>>
>>>>
>>>>
>>>> There are no other controllers acting on this data, and no combination
>>>> of anything I try above gets me what I want.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/HiTi-ofCemA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to