[Bese-devel] Re: validators and null values

Ryan Davis ryan at acceleration.net
Fri Apr 28 15:05:43 UTC 2006


>> * Russ' regex validator, an improved email validator, and a phone-number
>> validator based upon it.
>>     
>
> nice. are we sure cl-ppcre and javascript have the same syntax for
> regexps?
>   
The ECMA spec (at least this one from 1999: 
http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf) 
says on pg 141, section 15.10:

NOTE
The form and functionality of regular expressions is modelled [sic] 
after the regular expression facility in the
Perl 5 programming language.

So... I take that to mean javascript regexps have the same syntax in 
most cases, but don't be surprised if esoteric stuff breaks.

Ryan Davis
Acceleration.net
Director of Programming Services
2831 NW 41st street, suite B
Gainesville, FL 32606

Office: 352-335-6500 x 124
Fax: 352-335-6506



Marco Baringer wrote:
> "Nathan Bird" <nathan at acceleration.net> writes:
>
>   
>> Number-range-validator should inherit from is-a-number validator, it doesn't
>> make sense to check if a string is inside a number range, and so we've got
>> to do the work of ensuring it is a number first anyways. Previously this was
>> being handled kindof by parse-integer (would return nil or any integer found
>> in the string), and would break for number range validator (I expanded the
>> examples/forms.lisp in order to show this)
>>
>> Is-an-integer-validator previously allowed 11.3 without giving any error and
>> returned value 11. It now fails the is-an-integer validate.
>>     
>
> nice. applied everything.
>
>   
>> Things I came across but didn't change:
>>
>> (value number-field): if the client didn't enter anything in, shouldn't we
>> return nil and not 0?
>>     
>
> yes.
>
>   
>> I don't think there is a need for the integer-range-validator anymore.
>> Number-range-validator takes care of it, and if you are using the
>> integer-field you already have the is-an-integer-validator attached.
>>     
>
> agreed.
>
>   
>> Adding a 'required' initarg (that is itself optional :-) to form-field to
>> automatically attach the required validator to anything. This is such a
>> common case we probably want to make it easier.
>>     
>
> agreed.
>
>   
>> The javascript validation is still untested, but was broken previously do to
>> an id mismatch (at least on the examples page). I will try to look into this
>> further somewhere in the near future.
>>
>>
>> Buy now (from ucw_public) and you ALSO GET!
>> * a second patch where I rearrange the file a bit to try to reduce the
>> number of style-warnings due to undeclared functions.
>> * more documentation
>>     
>
> much abliged.
>
>   
>> * Russ' regex validator, an improved email validator, and a phone-number
>> validator based upon it.
>>     
>
> nice. are we sure cl-ppcre and javascript have the same syntax for
> regexps?
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/bese-devel/attachments/20060428/031f27cb/attachment.html>


More information about the bese-devel mailing list