This article describes how to assign the content in the kindeditor editor to the textarea method when submitting a form through Ajax. For more information, see.
KindEditor cannot get the textarea text box value in Firefox or other browsers.
First, describe the KindEditor error:
1. No value is obtained in IE8/FF;
2. When you click the full screen button of KindEditor to switch to full screen mode, the system returns to normal mode to obtain the value;
3. I used jQuery's ajax click event to submit a form and cannot get the value;
4. directly use the form submit button to obtain the value.
So how can we solve these problems?
| The Code is as follows: |
Copy code |
|
<Script type = "text/javascript">
KindEditor. ready (function (K ){
K. create ('<span class = 'wp _ keywordlink_affiliate'> <a href = "textarea" title = "view all articles in textarea" target = "_ blank"> textarea </> </span> [name = "content"] ', {
ThemeType: 'simple ',
ResizeType: 1,
UploadJson: 'common/KEditor/upload_json.php ',
FileManagerJson: 'common/KEditor/file_manager_json.php ',
AllowFileManager: true,
// The following line of code is the key. when the focus is lost, execute this. sync () and synchronize the input value to textarea;
AfterBlur: function () {this. sync ();}
});
});
</Script> |