当前位置: 代码迷 >> Java Web开发 >> FCKeditor取值有关问题
  详细解决方案

FCKeditor取值有关问题

热度:2970   发布时间:2013-02-25 21:19:21.0
FCKeditor取值问题
下面的方法是FCKeditor包里的一个例子改写成的。
问题是必须在页面取到form1.FCKeditor1.value的值。怎样才能取到?

<html> 
  <head> 
   
  <title> </title> 
<script type="text/javascript" src="/mybbs/fckeditor/fckeditor.js"> </script> 
<script language="JavaScript" type="text/javascript" charset="utf-8"> 
  window.onload = function()
  {
var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
oFCKeditor.BasePath = '/mybbs/fckeditor/' ; 
  oFCKeditor.Height = 300 ; 
  oFCKeditor.Width = 500; 
  oFCKeditor.ToolbarSet = 'Basic';
oFCKeditor.ReplaceTextarea() ;
  }
  function check(){
  var a=form1.FCKeditor1.value;
  alert(a); //这里是空值。如何让这里取到值???
  form1.submit();
  }
  </script> 
  </head>

<body>
  <form action="test.do" method="post" name="form1">
  <textarea name="FCKeditor1" rows="10" cols="80"></textarea>
  <input type="button" onclick="check()">
  </form>
</body>


------解决方案--------------------------------------------------------
引用楼主 acai9527 的帖子:
下面的方法是FCKeditor包里的一个例子改写成的。
问题是必须在页面取到form1.FCKeditor1.value的值。怎样才能取到?

<html>
<head>

<title> </title>
<script type="text/javascript" src="/mybbs/fckeditor/fckeditor.js"> </script>
<script language="JavaScript" type="text/javascript" charset="utf-8">
window.onload = function()
{
var oFCKeditor = new FCKeditor( 'FCKeditor…
  相关解决方案