开发者

How will use ck editor instances for array name filed?

              <textarea name="page[content]" id="content" class="medium-width" style="height:100px;"></textarea>
              <script type="text/javascript">
                        CKEDITOR.replace( 'page[content]' );
                        $('#btn').click(function(){
                            CKEDITOR.instances.page[content].updateElement();
                 开发者_如何学运维           }); 
                  </script>

I'm using array name for my textarea field.It is working well for call CKEDITOR.replace( 'page[content]' );

Now my problem is here CKEDITOR.instances.page[content].updateElement()...Here how can i use array field name?...

If i use normal name,it working well.

How can i use array name CKEDITOR.instances.page[content].updateElement() here?


You can call it by it's id as well, see http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.html#.replace

<script type="text/javascript">
    CKEDITOR.replace( 'content' );
    $('#btn').click(function(){
        CKEDITOR.instances.content.updateElement();
    }); 
</script>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜