jQuery refuses to post after validation

I've added some validation to my jQuery code to check for blank text fields before it posts a message but it doesn't seem to be working. No messages are being posted at all to my wall. Any idea how I can fix this?

HTML

<div id="header">
  <div class="container"> <span id="text_header">Virtual Idea Wall</span> </div>
</div>
<div id="main">
  <div class="container">
    <div id="chat"></div>
  </div>
</div>
<div id="footer">
  <div class="container">
      <p>
        <label for="title">Please give your idea a title</label>
        <br />
        <input type="text" id="title" name="title"/>
      </p>
      <p>
        <label for="message">Please provide details of your idea</label>
        <br>
        <input type="text" id="message" name="message"/>
      </p>
      <p>
        <input type="submit" id="sendmessage">
      </p>
      </input>
  </div>
</div>

jQuery

jQuery(function ($) {
    var socket = io.connect();
    var $messageForm = $('#sendmessage');
    var $messageTitle = $('#title');
    var $messageBox = $('#message');
    var $chat = $('#chat');

    $messageForm.click(function () {
        if ($.trim($("#title").val()).length === 0) {
            alert('You must provide valid input');
            $messageTitle.val('');
            $messageBox.val('');
            return false;
        }
        if ($.trim($("#message").val()).length === 0) {
            alert('You must provide valid input');
            $messageTitle.val('');
            $messageBox.val('');
            return false;
        } else {
            e.preventDefault();
            socket.emit('send message', '<b>' + $messageTitle.val() + '</b>' + '&nbsp;-&nbsp;' + $messageBox.val());
            $messageTitle.val('');
            $messageBox.val('');
        }

        socket.on('new message', function (data) {
            $chat.prepend(data + "<br/>");
        });
    });
});

Your click function is not passing in the event "e" so that would stop this from working when you make a call to "e.preventDefault()".

I made this jsfiddle - no socket support - but it does alert my message. http://jsfiddle.net/4v2QT/

This is the only change (the e passing into the function)

$messageForm.click(function (e) {
    ... code goes here!
}