<div class="main_body">
<form id="sform" action="product-add.php" method="post" enctype="multipart/form-data">
<table class="inputform" cellpadding="1" cellspacing="1">
<td class="label">产品标题</td><td class="input"><textarea class="txt" name="productdescription" style="width:200px;height:110px;"></textarea></td>
<td class="label">产品介绍</td><td class="input"><textarea id="contentform" rows="1" cols="1" style="width:580px;height:360px;" name="productcontent"></textarea>
<!-- Load TinyMCE -->
<script type="text/javascript" src="tiny_mce/jquery.tinymce.js"></script>
<script type="text/javascript" src="tiny_mce/plugins/swampy_browser/sb.js"></script>
<script type="text/javascript">
$().ready(function() {
$("#contentform").tinymce({
// Location of TinyMCE script
script_url : 'tiny_mce/tiny_mce.js',
// General options
theme : "advanced",
language : "zh",
width : "580",
height : "360",
add_unload_trigger : true,
plugins : "Ybrowser,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist",
// Theme options
theme_advanced_buttons1 : "undo,redo,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "forecolor,backcolor,del,ins,|,cut,copy,paste,pastetext,pasteword,|,outdent,indent,attribs,|,link,unlink,anchor,image,Ybrowser,media,cleanup,|,preview,code,fullscreen",
theme_advanced_buttons3 : "",
theme_advanced_buttons4 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : false,
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js"
});
var formoptions = {
beforeSubmit: function() {
$("#submitbtn").val("正在处理...");
$("#submitbtn").attr("disabled","disabled");
},
beforeSerialize: function($form, options) {
tinyMCE.triggerSave();
},
success: function (msg) {
alert(msg);
if(msg == "产品添加成功!")
$("#sform").resetForm();
$("#submitbtn").val("提交");
$("#submitbtn").attr("disabled","");
}
};
$("#sform").ajaxForm(formoptions);
$("#pubdate").datetimepicker({
showSecond: true,
timeFormat: 'hh:mm:ss',
hour:16,
minute:43,
second:26,
closeText:'完成',
currentText:'当前时间'
});
});
</script>
<!-- /TinyMCE -->
</td></tr>
</table>
tinymce编辑框输入内容后分析所得源代码