From aac8182a1d72ce7a2833ce257278dac617ee48a7 Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Thu, 16 May 2013 14:38:22 -0400 Subject: [PATCH] dont allow empty or short post title and body --- public/src/app.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/public/src/app.js b/public/src/app.js index b8d2afd710..8139fbdad1 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -212,10 +212,10 @@ var socket, content.value = ''; }; app.post_topic = function(category_id) { - var title = document.getElementById('post_title'), - content = document.getElementById('post_content'); + var title = $('#post_title'), + content = $('#post_content'); - if (title.length < 5 || content.length < 5) { + if (title.val().length < 5 || content.val().length < 5) { app.alert({ title: 'Topic Post Failure', message: 'You need to write more dude.', @@ -227,15 +227,15 @@ var socket, } socket.emit('api:topics.post', { - 'title' : title.value, - 'content' : content.value, + 'title' : title.val(), + 'content' : content.val(), 'category_id' : category_id }); jQuery(post_window).slideUp(250); $(document.body).removeClass('composing'); - title.value = ''; - content.value = ''; + title.val(''); + content.val(''); }; app.edit_post = function(pid) {