Michiel Meeuwissen wrote:
Ernst Bunders wrote:
small question: if you never enforce the pattern, then why define it at
all?
It means that it is never enforced by MMBase then, so it will not cause
an error if the input fails to obey it. You can still request the
pattern and use it e.g. to decide whether the input form entry must
become a textarea or not, or to generate validating javascript with it
or so.
E.g. the taglib's 'mm:fieldinfo' now checks if the pattern allows a newline,
and if so, it generates a textarea, and otherwise a normal one-line
input box.
so, if i am correct, the mapping between field types and actual input
fields is undefined and arbitrary? that seems like a bit of a hole in
the fied types specification. has it never been considered to define
this aspect as well?
ernst
There is also 'enforce="oncreate"', in which case mmbase will only throw
errors if new input is invalid. enforce="onchange" will only enforce if
a field value is changed. This can be used for backwards compatibility,
but also for datatypes for wich the validity of values can change in
time (like datetime values with a minummum value relative to the current
time).
Michiel
_______________________________________________
Developers mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/developers