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

Reply via email to