1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
2 | <!-- |
---|
3 | Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. |
---|
4 | For licensing, see LICENSE.html or http://ckeditor.com/license |
---|
5 | --> |
---|
6 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
7 | <head> |
---|
8 | <title>Replace Textarea by Code - CKEditor Sample</title> |
---|
9 | <script type="text/javascript" src="sample.js"></script> |
---|
10 | </head> |
---|
11 | <body> |
---|
12 | <div id="html"> |
---|
13 | <form action="sample_posteddata.php" method="post"> |
---|
14 | <p> |
---|
15 | <label for="editor1"> |
---|
16 | Editor 1:</label><br /> |
---|
17 | <textarea id="editor1" name="editor1" rows="10" cols="80"> |
---|
18 | <ol> |
---|
19 | <li> |
---|
20 | list |
---|
21 | </li> |
---|
22 | </ol> |
---|
23 | </textarea> |
---|
24 | <script type="text/javascript"> |
---|
25 | //<![CDATA[ |
---|
26 | |
---|
27 | // This call can be placed at any point after the |
---|
28 | // <textarea>, or inside a <head><script> in a |
---|
29 | // window.onload event handler. |
---|
30 | |
---|
31 | // Replace the <textarea id="editor"> with an CKEditor |
---|
32 | // instance, using default configurations. |
---|
33 | CKEDITOR.replace( 'editor1' , { |
---|
34 | enterMode : CKEDITOR.ENTER_BR |
---|
35 | }); |
---|
36 | |
---|
37 | //]]> |
---|
38 | </script> |
---|
39 | </p> |
---|
40 | <input type="submit" value="Submit" /> |
---|
41 | </form> |
---|
42 | </div> |
---|
43 | <div id="code"> |
---|
44 | <pre> |
---|
45 | <form action=""> |
---|
46 | <p> |
---|
47 | <label for="editor1"> |
---|
48 | Editor 1:</label><br /> |
---|
49 | <textarea <b>name="editor1"</b> rows="10" cols="80"><p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">CKEditor</a>.</p></textarea> |
---|
50 | <script type="text/javascript"> |
---|
51 | //<![CDATA[ |
---|
52 | |
---|
53 | <b>CKEDITOR.replace( 'editor1' );</b> |
---|
54 | |
---|
55 | //]]> |
---|
56 | </script> |
---|
57 | </p> |
---|
58 | <p> |
---|
59 | <input type="submit" value="Submit" /> |
---|
60 | </p> |
---|
61 | </form> |
---|
62 | </pre> |
---|
63 | </div> |
---|
64 | </body> |
---|
65 | </html> |
---|