Ticket #6906: test.html

File test.html, 2.2 KB (added by Jakub Ś, 12 years ago)
Line 
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; float: left; }
15                label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
16        </style>
17 </head>
18        <body id="mybody">
19
20        <form action="" method="get" id="myTestform">
21                <fieldset>
22                        <p>
23                                <label for="editor1">Your comment</label>
24                                <em>*</em><textarea cols="80" id="editor1" name="eeditor1" rows="10" class="required error"></textarea>
25                        </p>           
26                        <p>
27                                <label for="editor1">Your comment</label>
28                                <em>*</em><textarea cols="80" id="editor2" name="eeditor2" rows="1" class="required error"></textarea>
29                        </p>                   
30                        <p>             
31                                <input type="submit" value="Submit" id="mysubmit"/>                     
32                        </p>   
33                </fieldset>     
34        </form>         
35       
36<script type="text/javascript">
37   //<![CDATA[
38    $(document).ready(function () {
39        $('#editor1').ckeditor();
40        $('#myTestform').submit(function(){return onFirstSubmit();});
41    });
42
43    function onFirstSubmit() {         
44                var editor = '';
45                try{   
46                        editor = $('#editor1').ckeditorGet();
47                        editor.updateElement();         
48                }catch(err){ 
49                        console.log(err);
50                }               
51                //if (typeof CKEDITOR !== "undefined") {
52                        //for ( instance in CKEDITOR.instances )
53                                //CKEDITOR.instances[instance].updateElement();
54                //}
55                var helper = $('#myTestform').validate({               
56                ignore: '', //!!! Do not ignore hidden fields!!!
57                rules:{
58                        eeditor1 : 'required',
59                        eeditor2 : 'required',
60                }
61                }).form();     
62               
63                if(!helper)
64                        return false;
65    }
66    //]]>
67</script>
68       
69 </body>
70</html>
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy