1 $(document).ready(function(){
4 $('#sendMessage').validate({
13 highlight: function(element) {
15 .closest('.form-group').addClass('has-error').removeClass('has-success');
17 success: function(element) {
19 .closest('.form-group').removeClass('has-error').addClass('has-success');
23 // $('#sendMessage').validate();
25 $('#page').scroll(function(){
26 var r = $('#page')[0].scrollHeight- $('#page').height();
27 //alert($('#page').scrollTop() + " and " + r);
29 if($('#page').scrollTop() == r){
32 //alert(load + "scroll detected" + "scrollHeight and page height: " + r);
33 //$.post("try.php", {load:load}, function( data ))
34 //$('#page').append( data );
36 $.post( "try.php", {load:load}, function( data ) {
37 $( "#list" ).append( data );
41 $('#textarea_feedback').val(text_max);
43 $('#messageBox').keyup(function() {
44 var text_length = $('#messageBox').val().length;
45 var text_remaining = text_max - text_length;
47 $('#textarea_feedback').val(text_remaining);