WYSIWYG Editor Alert On Submit To Find Script Tags In HTML Formatter For CKEditor

I am trying to do a validation check after the user tries to insert <script>

a Formatter (HTML) tag for CKEditor.

I'm only doing this for the sake of User Experience as I know the scripts are locked by the awesome editor by default.

My approach is to use Javascript / jQuery and block script tags in the frontend before sending the data as email. However, I'm not sure why this doesn't work. I am attaching the relevant code.

  $("#sendBtn").click(function(){
        $("#messageBody").change(function(){
            if($("#messageBody").indexOf("<script>")  == 1){
                alert("No Script Tags Allowed!");
                return false;
            }   
    });
});

      

I would really appreciate any help on this issue!

+3
javascript jquery ckeditor wysiwyg onsubmit


source to share


No one has answered this question yet

Check out similar questions:

1375
Where should I put <script> tags in my HTML markup?
ten
Saving SCRIPT tags (and more) in CKEditor
five
How to make spell check work with CKeditor wysiwyg editor
2
CKEditor displaying HTML tags in editor
2
ckeditor adds html tags to the database
1
Inserting Tags (WYSIWYG JavaScript editor)
1
JQuery editor CKEditor WYSIWYG shows me all buttons
0
ckeditor allowedExtraContent with html closing tag
0
Add "name" attribute to <a> tags in WYSIWYG editor ... CKEditor or otherwise </a>



All Articles
Loading...
X
Show
Funny
Dev
Pics