开发者

How will use ck editor instances for array name filed?

开发者 https://www.devze.com 2023-03-12 03:02 出处:网络
<textarea name=\"page[content]\" id=\"content\" class=\"medium-width\" style=\"height:100px;\"></textarea>
              <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

精彩评论

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