0

I'm using the FormServiceProvider in Silex to generate my forms. Now I want to put a default text in a generated textarea. (not a placeholder! && the attribute 'value' I use on my textfields doens't work on a textarea)

I know the text in a textarea is between the tags, but I don't find an option to fill this tags with my FormServiceProvider.

Is it possible?

Example code:

  $form = $app['form.factory']->createNamed('form')
       ->add('description', 'textarea',
            array('attr (??)' => array(' ??? (not placeholder or value!!) ??? ' => 'Default text')),
        )
francisMi
  • 925
  • 3
  • 15
  • 31
  • Already asked: http://stackoverflow.com/questions/7913086/how-to-set-default-value-for-form-field-in-symfony2 – gunnx May 02 '13 at 15:46
  • Yes and no: The question there is about text FIELDS, not text AREA's. I used 'value' for all my text fields, and that didn't work in text area's. – francisMi May 03 '13 at 12:30

1 Answers1

1

The solution:

array('data' => 'Default text')
francisMi
  • 925
  • 3
  • 15
  • 31