[symfony-users] Re: isValid always showing false

2010-04-20 Thread kim
I want to validate my object cause these will not be given in by a form but by URL (cause the frontend requires this) so actualy i want a modelvalidation but i don't think this is possible so i tried putting my object in the form and then validate the form. but it always returns false and i

Re: [symfony-users] Re: isValid always showing false

2010-04-20 Thread Gareth McCumskey
You need to bind posted values to the form object for isValid() to run the validation checks. Assuming form_values is a form array where each field in the form is named as name=form_values[fieldname] then this is how: $form_object = new FormObject();

[symfony-users] Re: isValid always showing false

2010-04-20 Thread john
If you want to validate your existing objects, you can bind the form with the defaults. On Apr 20, 12:34 pm, kim thechosendra...@gmail.com wrote: I want to validate my object cause these will not be given in by a form but by URL (cause the frontend requires this) so actualy i want a

[symfony-users] Re: isValid always showing false

2010-04-19 Thread smileua
Form validates only during sfForm::bind and only values given to sfForm::bind, ie try $form = new paperForm(); $form-bind( array( 'paper' = $paper )); if ( $form-isValid() ){ } But are you sure to use form for purposes? sfForm is designed for user input, not for another things On Apr 19, 5:37 pm,