Synchronize the textarea

Edit this page

Synchronize the textarea

When the textarea is transformed into a CKEditor widget, the textarea value is no more populated except when the form is submitted. Then, it leads to issues when you try to serialize the form or you try to rely on the textarea value in JavaScript. To automatically synchronize the textarea value, you can do it globally in your configuration:

# app/config/config.yml
    input_sync: true

Or you can do it in your widget:

$builder->add('field', 'ckeditor', array('input_sync' => true));
This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.