Reputation: 501
I am using the Yii editMe Extension in one of my forms. The WYSIWYG editor populates perfectly fine and works fine however when you save none of the changes are saved.
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'content-form',
'enableAjaxValidation'=>false,
)); ?>
<p class="note">Fields with <span class="required">*</span> are required.</p>
<?php echo $form->errorSummary($model); ?>
<div class="row">
<?php echo $form->labelEx($model,'content_title'); ?>
<?php echo $form->textField($model,'content_title',array('size'=>60,'maxlength'=>80)); ?>
<?php echo $form->error($model,'content_title'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'content_text'); ?>
<?php $this->widget('ext.editMe.ExtEditMe', array(
'model'=>$model,
'attribute'=>'content_text',
));?>
<?php echo $form->error($model,'content_text'); ?>
</div>
<div class="row buttons">
<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
</div>
<?php $this->endWidget(); ?>
</div><!-- form -->
That is the code for my form page.
Upvotes: 0
Views: 877
Reputation: 681
I was having the same problem, so I did a little digging. The widget should be inserted in a <form>
...</form>
whose action attribute is set. No submit button required. The extension's own save button gets activated by this change and works seamlessly.
Upvotes: 1