日期:2014-05-17  浏览次数:20753 次

jsp界面中的编辑器怎么取里面的值
我用struts2,<s:textarea cols="60" rows="5" name="note.content" id="content"></s:textarea>
<script type="text/javascript">
richText("content",300,"<%=basePath%>fckeditor/");
</script>
这样的,我要用js取到编辑器里面的值,在页面判定填写的字段的长度。可是取不到这个里面的值。

------解决方案--------------------
document.getElementById("content").value;
------解决方案--------------------
直接根据ID取值判断就可以了啊
------解决方案--------------------
或者用jquery:
$(#content).val();
------解决方案--------------------
// 获取FCKEditor中的内容: content为Editor实例的ID
function getEditorContents(){
var oEditor = FCKeditorAPI.GetInstance("content");
alert(oEditor.GetXHTML(true));
 }
------解决方案--------------------
探讨
或者用jquery:
$(#content).val();