| 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>Maunal test for #10689</title> |
|---|
| 9 | <meta charset="utf-8"> |
|---|
| 10 | <script src="http://ckeditor.dev/ckeditor.js"></script> |
|---|
| 11 | </head> |
|---|
| 12 | <body> |
|---|
| 13 | <h1 class="samples"> |
|---|
| 14 | Maunal test for #10689 |
|---|
| 15 | </h1> |
|---|
| 16 | |
|---|
| 17 | <h2>case 1: two textareas</h2> |
|---|
| 18 | <h3>Expected behavior:</h3> |
|---|
| 19 | <ul> |
|---|
| 20 | <li>when content of any editor is empty submit buttons and both save buttons should show error dialog,</li> |
|---|
| 21 | <li>when both editors have content submit button and both save buttons should send content of BOTH editors,</li> |
|---|
| 22 | </ul> |
|---|
| 23 | |
|---|
| 24 | <form action="http://ckeditor.dev/samples/sample_posteddata.php" method="post"> |
|---|
| 25 | <div> |
|---|
| 26 | <textarea id="editor1" name="editor1" required="true"></textarea> |
|---|
| 27 | <textarea id="editor2" name="editor2" required="true"></textarea> |
|---|
| 28 | <input type="submit" value="Submit"> |
|---|
| 29 | </div> |
|---|
| 30 | </form> |
|---|
| 31 | |
|---|
| 32 | <h2>case 2: textarea and one input[name=submit]</h2> |
|---|
| 33 | <h3>Expected behavior:</h3> |
|---|
| 34 | <p>Input with name=submit overwrites submit function so: |
|---|
| 35 | <ul> |
|---|
| 36 | <li>both save buttons should not work but there should be NO ERRORS,</li> |
|---|
| 37 | <li>submit button should work as in case 1,</li> |
|---|
| 38 | </ul> |
|---|
| 39 | |
|---|
| 40 | <form action="http://ckeditor.dev/samples/sample_posteddata.php" method="post"> |
|---|
| 41 | <div> |
|---|
| 42 | <textarea id="editor3" name="editor3" required="true"></textarea> |
|---|
| 43 | <textarea id="editor4" name="editor4" required="true"></textarea> |
|---|
| 44 | <input type="text" name="submit"> |
|---|
| 45 | <input type="submit" value="Submit"> |
|---|
| 46 | </div> |
|---|
| 47 | </form> |
|---|
| 48 | |
|---|
| 49 | <h2>case 3: textarea and two inputs[name=submit]</h2> |
|---|
| 50 | <h3>Expected behavior:</h3> |
|---|
| 51 | <p>Everything should works as in case 2.</p> |
|---|
| 52 | |
|---|
| 53 | <form action="http://ckeditor.dev/samples/sample_posteddata.php" method="post"> |
|---|
| 54 | <div> |
|---|
| 55 | <textarea id="editor5" name="editor5" required="true"></textarea> |
|---|
| 56 | <textarea id="editor6" name="editor6" required="true"></textarea> |
|---|
| 57 | <input type="text" name="submit"> |
|---|
| 58 | <input type="text" name="submit"> |
|---|
| 59 | <input type="submit" value="Submit"> |
|---|
| 60 | </div> |
|---|
| 61 | </form> |
|---|
| 62 | |
|---|
| 63 | <h2>case 4: inline textarea</h2> |
|---|
| 64 | <h3>Expected behavior:</h3> |
|---|
| 65 | <p>Submit button should send content of both textareas (event if they are empty).</p> |
|---|
| 66 | |
|---|
| 67 | <form action="http://ckeditor.dev/samples/sample_posteddata.php" method="post"> |
|---|
| 68 | <div> |
|---|
| 69 | <textarea id="inline1" name="inline1">inline1</textarea> |
|---|
| 70 | <textarea id="inline2" name="inline2">inline2</textarea> |
|---|
| 71 | <input type="submit" value="Submit"> |
|---|
| 72 | </div> |
|---|
| 73 | </form> |
|---|
| 74 | |
|---|
| 75 | <script> |
|---|
| 76 | var el, editor, |
|---|
| 77 | i = 1; |
|---|
| 78 | |
|---|
| 79 | while ( ( el = CKEDITOR.document.getById( 'editor' + i++ ) ) ) { |
|---|
| 80 | editor = CKEDITOR.replace( el, { |
|---|
| 81 | height: 70, |
|---|
| 82 | toolbar: [ [ 'Save' ] ] |
|---|
| 83 | } ); |
|---|
| 84 | |
|---|
| 85 | editor.on( 'required', function( evt ) { |
|---|
| 86 | alert( 'Content of ' + evt.editor.name + ' is required' ); |
|---|
| 87 | evt.cancel(); |
|---|
| 88 | } ); |
|---|
| 89 | } |
|---|
| 90 | |
|---|
| 91 | editor = CKEDITOR.inline( CKEDITOR.document.getById( 'inline1' ) ); |
|---|
| 92 | editor = CKEDITOR.inline( CKEDITOR.document.getById( 'inline2' ) ); |
|---|
| 93 | |
|---|
| 94 | </script> |
|---|
| 95 | </body> |
|---|
| 96 | </html> |
|---|