1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <title>test</title> |
---|
5 | <meta content="text/html; charset=utf-8" http-equiv="content-type" /> |
---|
6 | |
---|
7 | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> |
---|
8 | <script type="text/javascript" src="http://jzaefferer.github.com/jquery-validation/jquery.validate.js"></script> |
---|
9 | <script type="text/javascript" src="../ckeditor_source.js"></script> |
---|
10 | <script type="text/javascript" src="../adapters/jquery.js"></script> |
---|
11 | <script src="sample.js" type="text/javascript"></script> |
---|
12 | <link href="sample.css" rel="stylesheet" type="text/css" /> |
---|
13 | <style type="text/css"> |
---|
14 | label { width: 10em; } |
---|
15 | label.error { float: none; color: red; padding-left: .5em; vertical-align: top; } |
---|
16 | </style> |
---|
17 | <script> |
---|
18 | CKEDITOR.config.jqueryOverrideVal = true; |
---|
19 | </script> |
---|
20 | </head> |
---|
21 | <body id="mybody"> |
---|
22 | |
---|
23 | <form action="" method="get" id="myTestform"> |
---|
24 | <fieldset> |
---|
25 | <p> |
---|
26 | <label for="editor1">Your comment</label> |
---|
27 | <textarea cols="80" id="editor1" name="eeditor1" rows="10" >aaaa</textarea> |
---|
28 | </p> |
---|
29 | <p> |
---|
30 | <label for="editor1">Your comment</label> |
---|
31 | <textarea cols="80" id="editor2" name="eeditor2" rows="5" >bbb</textarea> |
---|
32 | </p> |
---|
33 | <p> |
---|
34 | <select id="multiple" multiple="multiple"> |
---|
35 | <option selected="selected">Multiple</option> |
---|
36 | <option>Multiple2</option> |
---|
37 | <option selected="selected">Multiple3</option> |
---|
38 | </select> |
---|
39 | </p> |
---|
40 | <p> |
---|
41 | <input type="button" value="Clickme" id="myclick"/> |
---|
42 | </p> |
---|
43 | </fieldset> |
---|
44 | </form> |
---|
45 | |
---|
46 | <script type="text/javascript"> |
---|
47 | //<![CDATA[ |
---|
48 | var ed1, ed2 = ''; |
---|
49 | $(document).ready(function () { |
---|
50 | ed1 = $('#editor1').ckeditor(); |
---|
51 | ed2 = $('#editor2').ckeditor(); |
---|
52 | $('#myclick').click(function(){return onMyClick();}); |
---|
53 | }); |
---|
54 | |
---|
55 | function onMyClick() { |
---|
56 | |
---|
57 | |
---|
58 | console.log(ed1.val()); |
---|
59 | console.log(ed2.val()); |
---|
60 | console.log($('#editor1').val()); |
---|
61 | console.log($('#editor2').val()); |
---|
62 | |
---|
63 | var multipleValues = $("#multiple").val() || []; |
---|
64 | console.log(multipleValues.join(", ")); |
---|
65 | return false; |
---|
66 | } |
---|
67 | //]]> |
---|
68 | </script> |
---|
69 | |
---|
70 | </body> |
---|
71 | </html> |
---|