Mercurial > public > sg101
comparison media/js/forums.js @ 126:b0d62247c3e4
Add some javascript to check for posting a blank comment. Change wording on forum error message for the same thing.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 14 Nov 2009 20:30:31 +0000 |
parents | 3ae999b0c53b |
children | 2d299909e074 |
comparison
equal
deleted
inserted
replaced
125:903ae6168071 | 126:b0d62247c3e4 |
---|---|
2 var postText = $('#id_body'); | 2 var postText = $('#id_body'); |
3 var postButton = $('#forums-reply-post'); | 3 var postButton = $('#forums-reply-post'); |
4 postButton.click(function () { | 4 postButton.click(function () { |
5 var text = $.trim(postText.val()); | 5 var text = $.trim(postText.val()); |
6 if (text.length == 0) { | 6 if (text.length == 0) { |
7 alert('Please enter some reply text.'); | 7 alert('Please enter some text.'); |
8 return false; | 8 return false; |
9 } | 9 } |
10 $(this).attr('disabled', 'disabled').val('Posting reply...'); | 10 $(this).attr('disabled', 'disabled').val('Posting reply...'); |
11 $.ajax({ | 11 $.ajax({ |
12 url: '/forums/quick-reply/', | 12 url: '/forums/quick-reply/', |