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 | <p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">CKEditor</a>.</p> |
---|
19 | </textarea> |
---|
20 | <script type="text/javascript"> |
---|
21 | //<![CDATA[ |
---|
22 | |
---|
23 | // This call can be placed at any point after the |
---|
24 | // <textarea>, or inside a <head><script> in a |
---|
25 | // window.onload event handler. |
---|
26 | |
---|
27 | // Replace the <textarea id="editor"> with an CKEditor |
---|
28 | // instance, using default configurations. |
---|
29 | CKEDITOR.on( 'instanceReady', function( evt ){ |
---|
30 | evt.editor.insertHtml( 'text' ); |
---|
31 | }); |
---|
32 | CKEDITOR.replace( 'editor1' , { |
---|
33 | language: 'en' |
---|
34 | }); |
---|
35 | |
---|
36 | //]]> |
---|
37 | </script> |
---|
38 | </p> |
---|
39 | <p> |
---|
40 | <input type="submit" value="Submit" /> |
---|
41 | </p> |
---|
42 | </form> |
---|
43 | </div> |
---|
44 | <div id="code"> |
---|
45 | <pre> |
---|
46 | <form action=""> |
---|
47 | <p> |
---|
48 | <label for="editor1"> |
---|
49 | Editor 1:</label><br /> |
---|
50 | <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> |
---|
51 | <script type="text/javascript"> |
---|
52 | //<![CDATA[ |
---|
53 | |
---|
54 | <b>CKEDITOR.replace( 'editor1' );</b> |
---|
55 | |
---|
56 | //]]> |
---|
57 | </script> |
---|
58 | </p> |
---|
59 | <p> |
---|
60 | <input type="submit" value="Submit" /> |
---|
61 | </p> |
---|
62 | </form> |
---|
63 | </pre> |
---|
64 | </div> |
---|
65 | </body> |
---|
66 | </html> |
---|