简体   繁体   English

验证所见即所得的编辑器文本区域

[英]Validate WYSIWYG editor textarea

I am using WYSIWYG editor box as textarea in a form in my website. 我在网站的表单中使用“所见即所得”编辑器框作为文本区域。 I want to validate the textarea (From WYSIWYG) . 我想验证textarea(来自WYSIWYG)。 Can you say any suggestion to validate this textarea (Not normal textarea added from WYSIWYG editor) in javascript? 您能否在javascript中说出任何验证此文本区域的建议(不是从“所见即所得”编辑器中添加的普通文本区域)?

I think you need something like this, hope it will help 我认为您需要这样的东西,希望对您有所帮助

$(document).ready(function(){

    $("#formId").submit(function(){
        var textArea = $('#textArea').val();

        if (textArea == "") {
              textArea.show();
              textArea.focus();
            return false;
        }
        else 
        {
            return true; 
        }
    });

});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM