Twitter bootstrap TbButton Reset不适用于redactorRow
请参阅以下代码:Twitter bootstrap TbButton Reset不适用于redactorRow,twitter-bootstrap,reset,redactor,Twitter Bootstrap,Reset,Redactor,请参阅以下代码: <?php $label = $model->isNewRecord ? 'Create' : 'Update'; $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array( 'id' => 'article-form', 'type' => 'horizontal', )); ?> <fieldset> <legend>
<?php
$label = $model->isNewRecord ? 'Create' : 'Update';
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
'id' => 'article-form',
'type' => 'horizontal',
));
?>
<fieldset>
<legend><?php echo $label ?> Article</legend>
<?php
echo $form->textFieldRow($model, 'title', array('class' => 'span5', 'maxlength' => 200));
echo $form->redactorRow($model, 'content');
?>
</fieldset>
<div class="form-actions">
<?php $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => $label)); ?>
<?php $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'reset', 'label' => 'Reset')); ?>
<?php $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'link', 'url' => url('article/index'), 'label' => 'Cancel')); ?>
</div>
<?php $this->endWidget(); ?>
文章
字段的第一个I类型:标题(文本字段)和内容(编校者)
第二,我点击重置按钮
=>结果:仅标题字段为空文本,不适用于内容
请帮我做这个
谢谢大家,我还没发现问题。 但我有jquery的解决方案
<?php
cs()->registerScript('reset', "
var firstContent = [];
$('.redactor_editor').each(function(index, value) {
firstContent.push($(this).html());
});
$(document).ready(function() {
$('button[type=\'reset\']').click(function() {
$('.redactor_editor').each(function(index, value) {
$(this).html(firstContent[index]);
});
});
});
", CClientScript::POS_LOAD);
?>