Hi,
apart from a solution to your question: This is bad coding. Try passing the
user_id as an option to the form from the action like:
$myForm=new xyzForm(null,array('user_id'=>$this->getUser()->getId()));
And in the form:
$this->setDefault('user_id',$this->getOption('user_id'));
Please read:
http://eatmymonkeydust.com/2009/08/symfony-forms-flexible-widgets-based-on-u
ser-credentials/
Regards,
Christopher.
P.S: It might help, if you said something like hello and goodbye :-)
-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]]
Im Auftrag von DC
Gesendet: Freitag, 11. Juni 2010 14:47
An: symfony users
Betreff: [symfony-users] sfWidgetFormInputHidden is not visible
I`m using:
$this->widgetSechema['user_id'] = new sfWidgetFormInputHidden();
$this->setDefault('user_id', sfContext::getInstance()->getUser()-
>getGuardUser()->getId());
in order for the "user_id" field to be invisible, and automatically
populated,
but instead it shows as a text input, with the value correctly set.
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en