Use of the html editor kindeditor and the editor kindeditor

Source: Internet
Author: User

Use of the html editor kindeditor and the editor kindeditor

1. download the latest KindEditor version.

2. Put kindeditor under the directory of your website and select any directory. You only need to set the correct path!

3. Add the TEXTAREA input box to display the location of the editor. If TEXTAREA already exists, add the ID in the property.

<Textarea id = "content_1" name = "content" style = "width: 700px; height: 300px;"> </textarea>


4. Add a reference to kindeditor on the corresponding page and add the following code:

<Script type = "text/javascript" charset = "UTF-8" src = "/editor/kindeditor. js"> </script>
<Script type = "text/javascript">
KE. show ({
Id: 'content _ 1' // ID of the TEXTAREA input box
});
</Script>

Src =... it varies depending on your kindeditor location.

Get the text content of textarea:
1. in <textarea id = "content_1" name = "content" style = "width: 700px; height: 300px;"> </textarea>
Add the hidden input and button following the code below:
<Input id = "content_1_1" type = "hidden" runat = "server" value = ""/>
<Asp: Button ID = "Button1" runat = "server" Text = "save" OnClientClick = "save ();" OnClick = "button#click" CssClass = "I _1"/>

Add event processing code
1. First, the client code is executed before the server Code. The Code is as follows:


Function save ()
{
Var s = KE. util. getData ("content_1 ");
S = KE. util. escape (s );
Document. getElementById ("content_1_1"). value = s;
}

The value of content_1_1 is retained in the server control.
2. The server code is as follows:


Protected void button#click (object sender, EventArgs e)
{
Write the server code you want to execute here, because it has already gone to the value.
}

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.