我在jsp文件中引入了fck控件,但是现在我想让这个textarea呈现灰色不可编辑状态,我在textarea里面加入了disabled属性没有反应,照样可以编辑,是什么错误呢?麻烦大家帮忙解决一下,呵呵~~
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
<script type="text/javascript">
window.onload=function(){
var oFCKeditor=new FCKeditor("Fckeditor1");
oFCKeditor.BasePath="fckeditor/";
oFCKeditor.Width="75%";
oFCKeditor.Height="400";
//oFCKeditor.Value="initial value";
oFCKeditor.ReplaceTextarea();
}
</script>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<textarea  name="Fckeditor1"></textarea>

解决方案 »

  1.   

    newsContent 编辑框定义为“newsContent”document.getElementById('newsContent').disabled=true;//禁止操作
    document.getElementById('newsContent').disabled=false;//可以操作
      

  2.   

    我试了一下,怎么还是不行呢?
    <script type="text/javascript" src="fckeditor/fckeditor.js"></script>
    <script type="text/javascript">
    window.onload=function(){
    var oFCKeditor=new FCKeditor("Fckeditor1");
    oFCKeditor.BasePath="fckeditor/";
    oFCKeditor.Width="75%";
    oFCKeditor.Height="400";
    oFCKeditor.ReplaceTextarea();
    document.getElementById('newsContent').disabled=true; 
    }
    </script>
    <textarea  name="Fckeditor1" id="newsContent"></textarea>
      

  3.   

    oFCKeditor.ReplaceTextarea(); 
    这好像是替代原来的文本域你替换后,就没有这个disabled这个属性了,换下其他的fck的构造方法,我记得好像有fck有个构造方法,里面直接直接带参数的。。