Edmund Urbani wrote: > > Hi! > > I have got a problem with the rules for checking field values in intake. > Somehow I cannot check for empty fields. I define the rule as explained in the > docs like this: > > .. > <field name="PersonName" key="personname" type="String"> > <rule name="minLength" value="1">Bitte geben Sie den Nachnamen an.</rule> > </field> > .. > > When I leave the field empty, intake does not report an error. > (isAllValid() still returns true)
not sure why this does not work. > I have experimented a bit with intake, and other rules actually do work as > expected, if the field value is not empty. It seems the rules simply > bypassed for empty fields and no checks are applied. So I also tried > setting the required messsage: > > .. > <field name="PersonName" key="personname" type="String"> > <required-message>Bitte geben Sie den Nachnamen an.</required-message> > </field> > .. > > Again, no error when I leave the field empty. Is this a bug in the intake > service (included in TDK 2.1 release) or am I doing something wrong? <required-message> is to provide a message that is to be displayed if the field is declared as required and the field is empty. It does not make the field required. <rule name="required" value="true">Bitte geben Sie den Nachnamen an.</rule> should work, though i have not looked at what's in 2.1 for a while. john mcnally -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
