【发布时间】:2014-01-03 05:58:33
【问题描述】:
我在 Yii Web 应用程序中使用 tinymce 编辑器。
所以我的问题是
我有一个包含不同语言的下拉框,例如 English, Urdu, Spanish 等。
该下拉列表下方有一个文本区域。
我想在该文本区域中填充数据。
当我选择任何语言时,它将显示说明。
如果我删除 tinymce 编辑器,以下代码可以正常工作。
我的 _form.php 中有一个代码
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'sorah-form',
// Please note: When you enable ajax validation, make sure the corresponding
// controller action is handling ajax validation correctly.
// There is a call to performAjaxValidation() commented in generated controller code.
// See class documentation of CActiveForm for details on this.
'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,'language_id'); ?>
<?php
$mylang = array();
foreach($language as $lang)
{
$mylang[$lang->id] = $lang->language_name;
}
echo CHtml::activeDropDownList($model, 'language_id', $mylang, array(
'ajax' => array(
'type'=>'POST',
'url'=>CController::createUrl('Sorah/bktext'),
'update'=>'#Sorah_background_text', // here i think, it needs some changes. But how ?
// or do you know how to write here javascript statement ?
)));
?>
<?php echo $form->error($model,'language_id'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'background_text'); ?>
<?php echo $form->textArea($model,'background_text',array('rows'=>6, 'cols'=>50)); ?>
<?php echo $form->error($model,'background_text'); ?>
</div>
<div class="row buttons">
<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
</div>
<?php $this->endWidget(); ?>
</div><!-- form -->
你能帮帮我吗,我该如何解决这个问题。
任何帮助将不胜感激。
谢谢。
【问题讨论】:
标签: php jquery ajax yii tinymce