gpt4 book ai didi

twitter-bootstrap - TbButton 重置不适用于 redactorRow

转载 作者:行者123 更新时间:2023-12-02 04:55:54 27 4
gpt4 key购买 nike

请看下面的代码:

<?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(); ?>

首先我输入字段:标题(文本字段)和内容(编者)其次我点击重置按钮=> 结果:只有 Title 字段是空文本,不适用于 Content。

请帮我做这件事!

感谢和问候,

最佳答案

我仍然没有找到问题所在。但是我有 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);
?>

效果很好!

有人有其他解决方案吗?请在这里分享!

非常感谢!

关于twitter-bootstrap - TbButton 重置不适用于 redactorRow,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22376419/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com