corrade-http-templates – Diff between revs 28 and 30
?pathlinks?
Rev 28 | Rev 30 | |||
---|---|---|---|---|
Line 18... | Line 18... | |||
18 | <!-- <link rel="stylesheet" href="css/style.css?v=1.1"> --> |
18 | <!-- <link rel="stylesheet" href="css/style.css?v=1.1"> --> |
|
19 | </head> |
19 | </head> |
|
Line 20... | Line 20... | |||
20 | |
20 | |
|
21 | <body> |
21 | <body> |
|
22 | <div class="container"> |
22 | <div class="container"> |
|
23 | <form role="form"> |
23 | <form role="form" data-toggle="validator"> |
|
24 | <div class="form-group"> |
24 | <div class="form-group"> |
|
25 | <textarea class="form-control" id="chat" readonly="readonly" rows="12"></textarea> |
25 | <textarea class="form-control" id="chat" readonly="readonly" rows="12"></textarea> |
|
26 | </div> |
26 | </div> |
|
27 | <div class="form-group"> |
27 | <div class="form-group"> |
|
28 | <div id="controls"> |
28 | <div id="controls"> |
|
29 | <div class="input-group"> |
29 | <div class="input-group"> |
|
30 | <input class="form-control" id="name" maxlength="8" type="text" value="Someone"> |
30 | <input class="form-control" id="name" maxlength="8" type="text" value="Someone" required> |
|
31 | <span class="input-group-addon">@</span> |
31 | <span class="input-group-addon">@</span> |
|
32 | <input class="form-control" id="message" type="text"> |
32 | <input class="form-control" id="message" type="text" required> |
|
33 | <span class="input-group-btn"> |
33 | <span class="input-group-btn"> |
|
34 | <button class="btn btn-default" id="send" type="button">Send</button> |
34 | <button class="btn btn-default" id="send" type="submit">Send</button> |
|
35 | </span> |
35 | </span> |
|
36 | </div> |
36 | </div> |
|
37 | </div> |
37 | </div> |
|
38 | </div> |
38 | </div> |
|
39 | </form> |
39 | </form> |
|
Line -... | Line 40... | |||
- | 40 | </div> |
||
40 | </div> |
41 | |
|
41 | |
42 | <!-- Include jQuery --> |
|
- | 43 | <script src="bower_components//jquery/dist/jquery.min.js"></script> |
||
- | 44 | <!-- Include Bootstrap Validator --> |
||
42 | <script type="text/javascript" src="bower_components//jquery/dist/jquery.min.js"></script> |
45 | <script src="bower_components/bootstrap-validator/js/validator.js"></script> |
|
43 | <script type="text/javascript"> |
46 | <script> |
|
44 | $(document).ready(function () { |
- | ||
45 | function sendGroupMessage() { |
- | ||
46 | // Do not send the message if either the name or the message is empty. |
- | ||
47 | // This check is performed in the PHP script as well. |
- | ||
48 | if($.trim($("#name").val()) == '' || $.trim($('#message').val()) == '') |
47 | $(document).ready(function () { |
|
49 | return; |
48 | function sendGroupMessage() { |
|
50 | // Hide the controls. |
49 | // Hide the controls. |
|
51 | $("#controls").animate({ opacity: 'hide' }, 'slow'); |
50 | $("#controls").animate({ opacity: 'hide' }, 'slow'); |
|
52 | // Make the POST request to the PHP script and pass the values of the fields. |
51 | // Make the POST request to the PHP script and pass the values of the fields. |