-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
you might want to add a 'required="false"' to those fields that are
not required. IE something like
<validator class="isnotempty" name="identifier_vereist">
<argument>identifier</argument>
<error>is niet ingevuld.</error>
</validator>
<validator class="isnotempty" name="title_vereist">
<argument>dc_title</argument>
<error>is niet ingevuld.</error>
</validator>
<validator class="string" name="title_te_lang" required="false">
<argument>dc_title</argument>
<parameter name="max">255</parameter>
<error>kan maximum 255 tekens bevatten.</error>
</validator>
should solve your problem.
good luck
felix
On May 23, 2007, at 2:25 PM, Bart Debunne wrote:
> Hello,
>
> I have a form that should not validate if some fields are empty and/
> or have a length of 255+ characters.
>
> For example:
> - id, creator, title should not be empty (ergo have to be filled in)
> - creator, title, description and source may not exceed 255 characters
> - description and source may be empty
>
> (The actual form is a bit longer but those fields should be exemplary)
>
> In my current validation xml I’ve created a validator for the above
> mentioned fields. Using class=”isnotempty” for the fields that have
> to be filled in and class=”string” with a max parameter set to 255,
> for those fields that may not contain more than 255 characters.
>
> On validation the validatormanager correctly returns the
> “isnotempty”-validators but the others fields (with the 255
> character limit) are returned as erroneous not only when they
> exceed the max parameter but also when they are empty, even when
> there is no “isnotempty”-validator specified for these fields.
>
> If tried different approaches, including clusering arguments
> etcetera, but none of these seem to do the job. What would be the
> correct way to validate my form as intended above?
>
> Illustration:
> ...
> <validator class="isnotempty" name="identifier_vereist">
> <argument>identifier</argument>
> <error>is niet ingevuld.</error>
> </validator>
> <validator class="isnotempty" name="title_vereist">
> <argument>dc_title</argument>
> <error>is niet ingevuld.</error>
> </validator>
> <validator class="string" name="title_te_lang" >
> <argument>dc_title</argument>
> <parameter name="max">255</parameter>
> <error>kan maximum 255 tekens bevatten.</error>
> </validator>
> ...
>
> Thanks in advance...
>
> Bart Debunne.
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.agavi.org/mailman/listinfo/users
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)
iD8DBQFGVDaGGLZ/2ixjPUARAlmrAJ4kYfQIyr35X6r8X3whKYerW54IZACfW6eh
TZ1lmJwSNH7Gt7a2NiBtTkE=
=te3G
-----END PGP SIGNATURE-----
_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users