0

我有我的编辑器的 HTML 代码

<script type="text/javascript" src="https://cdn.ckeditor.com/4.5.11/standard/ckeditor.js"></script>
<div class="FienlWrapper">
    <h3>Service Description</h3>
    <div class="form-group EditerBox"><textarea id="editor4" name="sensitive_information" class="dss" name="editor4"></textarea></div>
    <div class="form-group services_details"> <label>Confidential informationss</label>
        <div class="form-group"><textarea id="editor3" name="confidential_information" class="dss" name="editor3"></textarea></textarea></div>
    </div>
    <div class="form-group services_details"> <label>Standard Instructions</label>
        <div class="form-group EditerBox"><textarea id="editor2" name="standard_instructions" class="dss" name="editor2"></textarea></textarea></div>
    </div>
    <div class="form-group services_details"> <label>Policies and Procedures</label>
        <div class="form-group "><textarea id="editor1" name="policies" class="dss" name="editor1"></textarea></div>
    </div>
</div>

还有我的脚本,我想检查所有给定的具有值或空值的编辑器,请帮助我,谢谢。

     <script type="text/javascript">

var editor = CKEDITOR.replace( 'editor1' );
// The "change" event is fired whenever a change is made in the editor.
editor.on( 'change', function( evt ) {

  $('#hiddedn input').val(evt.editor.getData());
  var data = CKEDITOR.instances.editor1.getData();
    if (data === '')
    {
        alert('please enter a comment');
    }else
    {
        $('#ser_descp').last().addClass( "active" );
    }
});
</script>
4

0 回答 0