ckeditor与jQuery表单向导

问题描述:

我正在创建一个基于jQuery向导的表单(表单分成5个步骤)wizard form,在最后两步中我分别放了两个ckeditor。我的问题是这两个ckeditor没有响应,即他们不接受任何input.I无法找出为什么会发生这种情况。相同的ckeditor工作正常,没有形式wizard.I认为形式向导插件和ckeditor插件之间存在冲突,但不知道那里发生了什么。ckeditor与jQuery表单向导

github上的示例项目Link of grails project

EDIT1:

这是我的自定义设置:

<div class="form-content"> 
    <div class="wizard-ignore"> 
<script type="text/javascript"> 
<ckeditor:config var="toolbar_Mytoolbar"> 
[ 
    [ 'Bold', 'Italic', 'Underline', 'Scayt' ] 
] 
</ckeditor:config> 

delete CKEDITOR.instances['${name}']; 
CKEDITOR.config.scayt_autoStartup = true; 
CKEDITOR.config.fillEmptyBlocks = false; 
function CKupdate() { 
    for (instance in CKEDITOR.instances) { 
     CKEDITOR.instances[instance].updateElement(); 
    } 
} 
<ckeditor:editor name="${name}" height="100px" width="98%" toolbar="Mytoolbar"> 
<g:if test="${summary}"> 
    ${summary} 
</g:if> 
</ckeditor:editor> 

</script> 
</div> 
</div> 

当我把一些警报();陈述在上面的脚本ckeditor工作在firefox.unable找到根本原因。任何建议/想法将对我有帮助。

编辑2: github上的示例项目Link of grails project

+0

有无你在控制台中检查了javascript erros? –

+0

我使用萤火虫,但它不显示任何JavaScript错误。 – Abs

Jan Sundman答案是绝对正确的,只需将类wizard-ignore添加到编辑器即可。


您使用grails CKEditor plugin,您可以设置类作为

<script type="text/javascript"> 
$(function() { 
    $("#${name}").addClass('wizard-ignore'); 

    <ckeditor:config var="toolbar_Mytoolbar"> 
    [ 
     [ 'Bold', 'Italic', 'Underline', 'Scayt' ] 
    ] 
    </ckeditor:config> 

    delete CKEDITOR.instances['${name}']; 
    CKEDITOR.config.scayt_autoStartup = true; 
    CKEDITOR.config.fillEmptyBlocks = false; 

    function CKupdate() { 
     for (instance in CKEDITOR.instances) { 
      CKEDITOR.instances[instance].updateElement(); 
     } 
    } 
}); 
</script> 
<ckeditor:editor name="${name}" height="100px" width="98%" toolbar="Mytoolbar"> 
    <g:if test="${summary}"> 
    ${summary} 
    </g:if> 
</ckeditor:editor> 

,如果你直接使用的CKEditor作为link描述则只需添加类作为

<g:textArea name="foo" class="wysiwyg wizard-ignore"> 
+0

这就是完美的工作..............谢谢。 – Abs

+0

欢呼家伙....:D – user1791574

设置类向导忽略编辑器,看看是否有帮助。

+0

请参阅我编辑的问题。 – Abs

+0

我添加了类向导忽略放置ckeditor的div,但它没有改变任何东西。 – Abs