2015-10-13 21 views
0

不張貼這裏是查看頁面TinMce值Yii中

<?php echo $form->labelEx($model, 'content'); ?>  
<?php echo $form->textArea($model, 'content', array('class' => 'tinymce', 'title' => 'Please enter Content','style'=> 'width:100%')); ?> 
<?php echo $form->error($model, 'content'); ?> 

雖然張貼我沒有收到在控制器這個數值我的textarea的代碼。請幫助我一個解決方案。

回答

0

您需要在提交時將tinyMCE編輯器的內容保存到textarea。

$('form#form_id').on('submit', function() { 
    tinyMCE.get('TinyMCEId').save(); 
}); 
+0

謝謝。我正在使用var contentText = tinyMCE.get('Locations_address')。getContent(); $('#Locations_address')。val(contentText);並將textarea的值設置爲tinymce tinyMCE.get(「Locations_address」).setContent($(「#Locations_address」).val());. – Sona