Kindeditor not get TEXTAREA value solution----to the end of the horizon

Source: Internet
Author: User

Previous friends have encountered this problem, is kindeditor under Firefox or other browsers can not get the value of textarea text box, click the Form Submit button to get blank. Yesterday Tianya PHP Blog [http://blog.phpha.com] also had no intention to encounter this problem, so want to seriously find the reason.
First of all, describe my side of the Kindeditor error phenomenon:
1, under the IE8/FF are not the value;
2, when click Kindeditor the full spell button to switch to full-screen mode input, and then return to normal mode, you can get the value;
3, I use the jquery Click event Submission Form, submit, can not get the value;
4, directly with the form of the submit button to get the value.

The following is an example of the Kindeditor 4.x version, the correct code is affixed first:

12345678910111213141516 <script Type="Text/javascript"> //Tianya PHP blog http://blog.phpha.comkindeditor. Ready(function(K){ K. Create(' textarea[name= ' content "] ', { themetype: ' simple ', resizetype: 1, Uploadjson: ' common/keditor/upload_json.php ', Filemanagerjson: ' common/keditor/file_manager_json.php ', allowfilemanager: true, //tested, this line of code is optional and does not affect getting the value of textarea//aftercreate:function () {This.sync ();}//The following line of code is the key, which executes This.sync () when the focus is lost;afterblur: function(){this. Sync();} });});</script>

Related instructions:
As you can see from the code above, the workaround lies in the last line of code, Afterblur:function () {This.sync ();}, executing This.sync () when the focus is lost;
then this this.sync (); What does the function do? Simply put: This function is to synchronize the value of Kindeditor to the TextArea text box.
Official explanation:
Tianya PHP Blog http://blog.phpha.com
Sync ()
Set the contents of the editor to the original textarea control.
Parameters: None
return: Keditor
Address: Http://www.kindsoft.net/docs/editor.html#sync

Supplement: In Kindeditor 4.x version, Ke.sync (); To be changed into This.sync ();

Kindeditor not get TEXTAREA value solution----to the end of the horizon

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.