1 | <!DOCTYPE html> |
---|
2 | <!-- |
---|
3 | Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. |
---|
4 | For licensing, see LICENSE.md or http://ckeditor.com/license |
---|
5 | --> |
---|
6 | <html> |
---|
7 | <head> |
---|
8 | <title>#10689</title> |
---|
9 | <meta charset="utf-8"> |
---|
10 | <script src="../ckeditor.js"></script> |
---|
11 | <link href="sample.css" rel="stylesheet"> |
---|
12 | </head> |
---|
13 | <body> |
---|
14 | <h1 class="samples"> |
---|
15 | #10689 |
---|
16 | </h1> |
---|
17 | |
---|
18 | <h2>two textareas</h2> |
---|
19 | |
---|
20 | <form action="sample_posteddata.php" method="post"> |
---|
21 | <div> |
---|
22 | <textarea id="editor1" name="editor1" required="true"></textarea> |
---|
23 | <textarea id="editor2" name="editor2" required="true"></textarea> |
---|
24 | <input type="submit" value="Submit"> |
---|
25 | </div> |
---|
26 | </form> |
---|
27 | |
---|
28 | <h2>textarea and one input[name=submit]</h2> |
---|
29 | |
---|
30 | <form action="sample_posteddata.php" method="post"> |
---|
31 | <div> |
---|
32 | <textarea id="editor3" name="editor3" required="true"></textarea> |
---|
33 | <input type="text" name="submit"> |
---|
34 | <input type="submit" value="Submit"> |
---|
35 | </div> |
---|
36 | </form> |
---|
37 | |
---|
38 | <h2>textarea and two inputs[name=submit]</h2> |
---|
39 | |
---|
40 | <form action="sample_posteddata.php" method="post"> |
---|
41 | <div> |
---|
42 | <textarea id="editor4" name="editor4" required="true"></textarea> |
---|
43 | <input type="text" name="submit"> |
---|
44 | <input type="text" name="submit"> |
---|
45 | <input type="submit" value="Submit"> |
---|
46 | </div> |
---|
47 | </form> |
---|
48 | |
---|
49 | <h2>two textareas and one input[name=submit]</h2> |
---|
50 | |
---|
51 | <form action="sample_posteddata.php" method="post"> |
---|
52 | <div> |
---|
53 | <textarea id="editor5" name="editor5" required="true"></textarea> |
---|
54 | <textarea id="editor6" name="editor6" required="true"></textarea> |
---|
55 | <input type="text" name="submit"> |
---|
56 | <input type="submit" value="Submit"> |
---|
57 | </div> |
---|
58 | </form> |
---|
59 | |
---|
60 | <script> |
---|
61 | var el, editor, |
---|
62 | i = 1; |
---|
63 | |
---|
64 | while ( ( el = CKEDITOR.document.getById( 'editor' + i++ ) ) ) { |
---|
65 | editor = CKEDITOR.replace( el, { |
---|
66 | height: 100, |
---|
67 | toolbar: [ [ 'Save' ] ] |
---|
68 | } ); |
---|
69 | |
---|
70 | editor.on( 'required', function( evt ) { |
---|
71 | alert( 'Content of ' + evt.editor.name + ' is required' ); |
---|
72 | evt.cancel(); |
---|
73 | } ); |
---|
74 | } |
---|
75 | </script> |
---|
76 | </body> |
---|
77 | </html> |
---|