update/validate embedded forms before saving in symfony
Posted
by
Stanislav Palatnik
on Stack Overflow
See other posts from Stack Overflow
or by Stanislav Palatnik
Published on 2011-01-05T05:35:44Z
Indexed on
2011/01/07
0:53 UTC
Read the original article
Hit count: 335
I would like to validate an embedded form field before it gets saved in the database. Currently it will save an empty value into the database if the form field is empty. I'm allowing empty fields, but I want nothing inserted if the form field is empty.
Also quick question, how to alter field values before validating/saving an embedded form field?
$this->form->getObject works in the action, but $this->embeddedForm->getObject says object not found
© Stack Overflow or respective owner