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>

そして、私のスクリプトがあり、値またはnullを持つ指定されたすべてのエディターをチェックしたいので、助けてください。

     <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