Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 84 lines (73 sloc) 2.422 kb
92b5e27 First commit
Glavan Dumitru authored
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <title>jQuery MessagBox Handler Demo</title>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6 <link rel="stylesheet" type="text/css" href="assets/messageBoxHandler.css" />
7 <script type="text/javascript" src="assets/jquery-1.4.4.min.js"></script>
8 <script type="text/javascript" src="assets/jquery.messageBoxHandler.js"></script>
9 </head>
10 <body>
11 <h1>jQuery MessagBox Handler Demo</h1>
12
72c8e17 Working plugin + style
Glavan Dumitru authored
13 <div class="message-box">
14 <form>
15 <textarea title="What are you doing?" rows="10" cols="70" name="update">What are you doing?</textarea>
16 <span>140</span>
17 <button type="submit">
18 Send
19 </button>
20 </form>
21 </div>
22
92b5e27 First commit
Glavan Dumitru authored
23 <h2>How To</h2>
24
25 <ol>
26 <li>Include the messageBox.css style</li>
27 <li>Include the messageBoxHandler.min.js file</li>
28 <li>Activate the plug-in: $('#messageBox').messageBoxHandler();</li>
29 </ol>
30
31 <h2>Options</h2>
32
33 <dl>
72c8e17 Working plugin + style
Glavan Dumitru authored
34 <dt><b>maxUpdateChars</b> (140):</dt>
35 <dd>
36 Maximum chars number user can fill in.
37 </dd>
38 <dt><b>messageBody</b> (null):</dt>
39 <dd>
40 The message body textarea selector. By default grabs the first textarea in the current element.
41 </dd>
42 <dt><b>submitBtn</b> (null):</dt>
43 <dd>
44 The submit button selector. By default grabs the first submit button in the current element.
45 </dd>
46 <dt><b>leftCharsCounterClass</b> (null):</dt>
92b5e27 First commit
Glavan Dumitru authored
47 <dd>
72c8e17 Working plugin + style
Glavan Dumitru authored
48 The left chars counter selector. By default grabs the first span in the current element.
49 </dd>
50 <dt><b>counterErrorClass</b> ('counter-error-length'):</dt>
51 <dd>
52 A class that will be added to the counter when the textarea gets too much text.
53 </dd>
54 <dt><b>disabledClass</b> ('disabled'):</dt>
55 <dd>
56 A class that will be appended to the submit button when the text is not valid.
57 </dd>
58 <dt><b>emptyMessageText</b> (''):</dt>
59 <dd>
60 A text that appears when the textarea is empty. It can grab the title attribute of the textarea if present for the sake of the translation.
92b5e27 First commit
Glavan Dumitru authored
61 </dd>
62 </dl>
63
64 <h2>Implementation</h2>
65
66 <h3>Very simple example</h3>
67
68 <pre>
69 &lt;script type=&quot;text/javascript&quot;&gt;
70 $(document).ready(function () {
72c8e17 Working plugin + style
Glavan Dumitru authored
71 $('.message-box').messageBoxHandler();
92b5e27 First commit
Glavan Dumitru authored
72 });
73 &lt;/script&gt;
74 </pre>
75
76 <script type="text/javascript">
77 $(document).ready(function () {
72c8e17 Working plugin + style
Glavan Dumitru authored
78 $('.message-box').messageBoxHandler();
92b5e27 First commit
Glavan Dumitru authored
79 });
80 </script>
81
82 </body>
83 </html>
Something went wrong with that request. Please try again.