我是新来的TinyMCE
......我仍然想知道这个问题
我有从 1 页动态加载的表单。表格上有tinyMCE textarea。在我在文本区域上放置一些值后第一次提交时,文本区域的值没有被$_REQUEST['Sub-Headline']
. 我必须再次单击提交按钮,有时我需要重新打开表单才能接收到值$_REQUEST['Sub-Headline'];
你们能建议我需要检查什么以及我应该添加哪些选项/其他内容吗?
这是表单的部分代码:
TinyMCE
<script type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,undo,redo",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
convert_urls : false,
plugins : "legacyoutput"
});
</script>
形式
<form action="web-block/forms/process-001.php" id="Frm001" method="post" class="general-form" enctype="multipart/form-data">
<div class="input-wrap">
<input class="clearme" name="Headline" value="<?php echo $Headline;?>" id="headline"/>
</div>
<div class="input-wrap">
<textarea class="clearme" name="Sub-Headline" id="subheadline"><?php echo $SubHeadline;?></textarea>
</div>
<label>Main Image</label>
<div class="up-mask">
<span class="file-wrapper">
<input type="file" name="pics" class="photo" id="pics" />
<span class="button">
<span class="default-txt">Upload Photo (Max Size 300Kb, 960x567 pixels)</span>
</span>
</span>
</div><!-- .up-mask -->
<input type="hidden" name="Key" id="Key" value="<?php echo urlencode($Key);?>"/>
<input type="submit" class="submit-btn" value="Save" />
<a href="#" id="reset">Reset</a>
<span class="save-notice"></span>
</form>
提交代码
$(document).ready(function() {
var options = {
beforeSubmit: function() {
alert("kuntul");
tinyMCE.triggerSave();
},
success: function() {
$('span.save-notice').text('Save Changed Successfully');
$('span.save-notice').show(2000);
$('span.save-notice').hide(2000);
}
};
$('#Frm001').submit(function() {
$(this).ajaxSubmit(options);
return false;
});
});
</script>