[FLOW3-general] form validation
Martin
titusmailing at googlemail.com
Tue Sep 25 14:40:40 CEST 2012
Hey,
if u put
* @ORM\Column(type="integer")
the default value will be 0
But the validation rules should catch ur "wrong" input.
HTH
Cheers
Martin
On 09/25/2012 12:08 PM, Winfried Holler wrote:
> I need some help with form validation .
> In my form there is a textfield (days) for an integer value.
> If the textfield is empty I get this exception when submitting the form
> (newAction):
>
> Integrity constraint violation: 1048 Column 'days' cannot be null
>
> How can I avoid this exception? Where can I define a default value, if days
> is null?
>
> definition in model:
> /**
> * The days
> * @var integer
> * @FLOW3\Validate(type="NotEmpty")
> * @FLOW3\Validate(type="Integer", options={ "minimum"=1, "maximum"=100 })
> */
> protected $days
>
> thx
>
>
>
More information about the FLOW3-general
mailing list