1 | |
---|
2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
3 | <head> |
---|
4 | <title>Sample - CKEditor</title> |
---|
5 | <meta content="text/html; charset=utf-8" http-equiv="content-type"/> |
---|
6 | <script type="text/javascript" src="../ckeditor.js"></script> |
---|
7 | <!--<script src="sample.js" type="text/javascript"></script> |
---|
8 | <link href="sample.css" rel="stylesheet" type="text/css"/>--> |
---|
9 | <script TYPE="text/javascript"> |
---|
10 | document.onkeyup = doKeyDown_winfunc; |
---|
11 | |
---|
12 | function doKeyDown_winfunc(e) |
---|
13 | { |
---|
14 | //alert("doKeyDown_winfunc Called"); |
---|
15 | var frm2 = document.getElementById("myform"); |
---|
16 | var KeyID = (window.event) ? event.keyCode : e.keyCode; |
---|
17 | |
---|
18 | if (KeyID == 13 || KeyID == 27) |
---|
19 | frm2.submit(); |
---|
20 | } |
---|
21 | |
---|
22 | |
---|
23 | function submitenter(e) |
---|
24 | { |
---|
25 | //alert("submitenter Called"); |
---|
26 | var keycode; |
---|
27 | var frm = document.getElementById("myform"); |
---|
28 | if (window.event) keycode = window.event.keyCode; |
---|
29 | else if (e) keycode = e.which || e.keyCode; |
---|
30 | else return true; |
---|
31 | |
---|
32 | if (keycode == 13 || keycode == 27) |
---|
33 | { |
---|
34 | // frm.submit(); |
---|
35 | return false; |
---|
36 | } |
---|
37 | else |
---|
38 | return true; |
---|
39 | } |
---|
40 | //--> |
---|
41 | </script> |
---|
42 | </head> |
---|
43 | |
---|
44 | |
---|
45 | |
---|
46 | |
---|
47 | <body onkeypress="return submitenter(event)"> |
---|
48 | |
---|
49 | |
---|
50 | <form id="myform" action="sample_posteddata.php" method="post"> |
---|
51 | <p> |
---|
52 | <label for="editor1">Editor 1:</label><br/> |
---|
53 | <textarea id='editor1' > Testing</textarea> |
---|
54 | <script type="text/javascript"> |
---|
55 | |
---|
56 | CKEDITOR.replace( 'editor1' ); |
---|
57 | CKEDITOR.config.skin = "office2003"; |
---|
58 | |
---|
59 | </script> |
---|
60 | </p> |
---|
61 | <p> |
---|
62 | |
---|
63 | <input name="myform" type="submit" value="Submit"/> |
---|
64 | </p> |
---|
65 | </form> |
---|
66 | |
---|
67 | </body> |
---|
68 | </html> |
---|