我在CakePHP应用程序中使用多个tinyMCE编辑器在单页上。 这是一个QnA应用程序。
我的代码是这样的 提问:
<script type="text/javascript">
tinyMCE.init({
mode:"textareas",
theme:"simple"
});
</script>
<form action="/qna/questions/add" class="innerForm" id="QuestionViewForm" method="post" accept-charset="utf-8">
<input name="data[Question][title]" placeholder="Please enter the title of your question" id="title"
class="span7 focusBlur" maxlength="255" type="text">
<textarea name="data[Question][description]" id="description" class="span7 questionDescription" div="false"
rows="5">Please enter
description</textarea>
<input class="btn blueBtn" type="submit" value="Add Your Question" data-original-title="">
<a href="javascript:;" class="link cancel" id="cancel" data-original-title="">Cancel</a>
</form>
回答:
<form action="/qna/answers/add" class="innerForm" id="AnswerForm" method="post" accept-charset="utf-8">
<textarea name="data[Answer][answer]" id="answer" class="span7 questionDescription" div="false" rows="5">Please enter answer</textarea>
<input class="btn blueBtn" type="submit" value="Add Your Question" data-original-title="">
<a href="javascript:;" class="link cancel" id="cancel" data-original-title="">Cancel</a>
但每当我提交一个问题表单时,它会在文本区域中给出值,它会跳过tinyMCE中的值。
输出是:
Array
(
[Question] => Array
(
[resource_id] => 1003
[type] => 0
[title] => This is my question
[description] => Please enter description
)
)
我输入了不同的问题描述:(
谢谢, 维杰