[TYPO3-mvc] Validation for EmailAddress called when nothing is filled in, not required property
Henjo Hoeksma
me at henjohoeksma.nl
Thu Jul 14 16:23:59 CEST 2011
On 2011-07-14 15:03:56 +0200, Miguel Ayala said:
> Hello Henjo,
> you could extend the EmailValidator and do something like:
> if string == "" then return true
> else return parent::isvalid(string)
>
> this is not real code(!), hope this helps
>
> Miguel
>
>
> ----- original message --------
>
> Subject: [TYPO3-mvc] Validation for EmailAddress called when nothing is
> filled in, not required property
> Sent: Thu, 14 Jul 2011
> From: Henjo Hoeksma<me at henjohoeksma.nl>
>
>> Hi list,
>>
>> I have a FE form for the adding of an object. The object contains an>
>> email address - but this is not a required property. If it is empty
>> the> model tries to validate the empty email address which results in
>> a> validation error of course.
>>
>> Any clue how to get around this?
>>
>> Thanks in advance!
>>
>> Henjo
>>
>> _______________________________________________
>> TYPO3-project-typo3v4mvc mailing list
>> TYPO3-project-typo3v4mvc at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>>
>
> --- original message end ----
Thanks for your response.
Yeah, that would be possible. But it doesn't make sense: I have not
stated the property to be required. So, empty should be allowed
default. If something is filled in it should be parsed through the
validator for email address.
That would be logical imho.
Henjo
More information about the TYPO3-project-typo3v4mvc
mailing list