javascript - SCEditor: Submit form with Shortcut Ctrl+Enter - How to get instance's parent? -


On my site there are many forms with textures, each textarera is assigned the Scederator plugin. I am now trying to submit a form by providing a shortcut.

First of all I had a key method assigned to each editor example:

  $ ('textarea [name = "test01"]'). Sceditor ('instance'). Key up (function (e) {if (e.ctrlKey & amp; ekeykey == 13) {console.log (this); // case1} // ...  
< P> and later I also found the underlying method:

  $ ('textarea [name = "test01"]'). Sceditor ('instance'). AddShortcut ('ctrl + enter, Submit;) Submit Function () {console.log (this); // case 2}  

My goal is to get the brother before the scaditer DIV, which is texter From there, I can find the submit button or I could just go under the Dom Tree and find out the text / scadeter

However, console.log (this); Case 1: The HTML of the node, i.e., in Web Developers Console, I can see Scuditter's HTML. For the case, I get the Scadditer object.

The problem is I can not use parent. Besides, I do not see

Handler when you add a shortcut, you know that the text Insect is going so that you can:

  $ ( 'textarea [name = "test01"]'). Sceditor ('instance'). AddShortcut ('Ctrl + enter', function () {submitform ($ ('textarea [name = "test01"]'). Get (0) .form);}); Function Submit Form (Form) {console.log}; }  

Work example:


Comments