富编辑textarea不会持有数据

时间:2013-01-09 16:01:00

标签: java javascript ajax

我有一个带有一些预设选项的HTML页面,当我使用普通的HTML textarea时这很好用, 但是当我使用丰富的编辑器时,textarea不会保存数据,请参阅演示页面。

工作页面:Here

非工作页面:Here

1 个答案:

答案 0 :(得分:0)

更改此代码

$mydropdown.change(function(){
   nicEditors.findEditor("TextArea").setContent($mytextbox.val() + TextVars[$(this).val()]);
}); 

$("input[type='checkbox'][name*='ImageVar']").change(function () {
  var $chk = $(this);
  if ($chk.prop('checked')) {
    nicEditors.findEditor("TextArea").setContent($mytextbox.val() + ImageVars[$chk.attr('name')]);
  } else {
    nicEditors.findEditor("TextArea").setContent($mytextbox.val().replace(ImageVars[$chk.attr('name')], ""));
  }
});

以下代码

$mydropdown.change(function(){
   nicEditors.findEditor("TextArea").setContent(nicEditors.findEditor("TextArea").getContent() + TextVars[$(this).val()]);
}); 

$("input[type='checkbox'][name*='ImageVar']").change(function(){
   var $chk = $(this);
   if($chk.prop('checked')){
      nicEditors.findEditor("TextArea").setContent(nicEditors.findEditor("TextArea").getContent() + ImageVars[$chk.attr('name')]);
   }else{
      nicEditors.findEditor("TextArea").setContent(nicEditors.findEditor("TextArea").getContent().replace(ImageVars[$chk.attr('name')], ""));
   }
}); 
相关问题