Hi again,

I am back with another problem in the same form : I can't get a hidden field to get initialized with a default value.

This is a portion of my code :

     $this->setWidgets(array(
       'object_id'    => new sfWidgetFormPropelChoice(
         array('model' => 'BioObject', 'add_empty' => true)),
       'user_id'      => new sfWidgetFormPropelChoice(
         array('model' => 'sfGuardUser', 'add_empty' => false)),
       'media_file'   => new sfWidgetFormInputFile(array(
         'label'     => 'Mi Video')),
       'is_stream'    => new sfWidgetFormInputHidden(),
       'date_created' =>  new sfWidgetFormInputHidden(
         array('default'=> '2009-05-21 16:31:35'))
     ));

The field i want to initialize is 'date_created'. But it never renders as i want, with the default value. It invariably renders :

<input type="hidden" name="video[date_created]" id="video_date_created" />

I also tried with :

$this->widgetSchema['date_created']->setOption('default', '2009-05-21 16:31:35');

But no luck either.

Would someone have any clue / pointer ?

Those are the validators, in case it's relevant :

   $this->setValidators(array(
'object_id' => new sfValidatorPropelChoice(array('model' => 'BioObject', 'column' => 'id', 'required' => true)), 'user_id' => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id', 'required' => true)),
     'media_file'   => new sfValidatorFile(array(
         'required' => true,
         'path' => sfConfig::get('sf_upload_dir').'/media',
       )),

     'is_stream'    => new sfValidatorBoolean(array('required' => false)),
'date_created' => new sfValidatorDate(array('date_output'=>'Y-m-d H:i:s'))
   ));



This project uses symfoiny 1.2.5 with propel.

Thanks !
M.

--
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

Reply via email to