how to avoid storing several times a repeated field of a Symfony form?

Posted by user454760 on Stack Overflow See other posts from Stack Overflow or by user454760
Published on 2011-01-11T17:49:21Z Indexed on 2011/01/11 20:53 UTC
Read the original article Hit count: 153

Filed under:
|
|

Hello everybody,

I am working with Symfony 1.4 and Doctrine. I have a model A with an email field. The form of A displays an input in which the user should insert the email correctly. But as everybody knows, sometimes they don't do it.

To fix this I have inserted an extra field in the model (and in the form), called *repeat_email* to prevent the misspellings. Then, in the validation process, after validating all the fields, i use a global validator to compare the data of the two fields.

This works, but I don't want to have the email stored two times in the database (I don't want the *repeat_email*). Is there any mechanism to use it in the validation process, but not to store it in the database?

Thanks,

© Stack Overflow or respective owner

Related posts about symfony

Related posts about doctrine