I installed the CKEditor Yii framework 2.0 extension with the following command.
php composer.phar require "2amigos/yii2-ckeditor-widget" "*"
I use it in my form with the following code.
use dosamigos\ckeditor\CKEditor; $form->field($myModel, 'text')->widget(CKEditor::className(), [ 'options' => ['rows' => 6], 'preset' => 'basic' ]);
In addition, I have a dropdown in my form. Assume the following.
<select id="select-number" class="form-control" name="MyModel[select-number]"> <option value="">-- Select a number --</option> <option value="1">Number 1</option> </select>
When one selects an option, I want to paste some default data into the CKEditor text area. How can I select the CKEditor text box and paste data into it?
source share