title: Need some assistance with an user not being able to send a message when the length of the input is 0
body: <p>At the moment ive got my code set up so that the user can send a message to the chatbot on my website.</p>
  <p>What i would like to do is, prevent the user from sending a message if userText is empty. Below is what i have so far:</p>
  <pre class="lang-js prettyprint-override"><code>function getUserResponse(){
      var userText = $('#textInput').val();  
      
      if(userText.val() == 0){
      
      }else{
          var userHTML = &quot;&lt;p class='userText'&gt;&lt;span&gt;&quot;+userText+&quot;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt; &lt;img src= {% static 'images/userIcon.png' %} width=50px height=50px  style='vertical-align: middle;' &gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;&quot;;
          $('#textInput').val(&quot;&quot;);
      }
      
  
      $('#chatbot').append(userHTML);
  
      $.get('/chatbotModel/getResponse',{userMessage:userText}).done(function(data){
          var returnedMessage = &quot;&lt;p class='botText'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;img src= {% static 'images/chatbot.png' %} width=50px height=50px  style='vertical-align: middle;' &gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;&quot;+data+&quot;&lt;/span/&gt;&lt;/p&gt;&quot;;
          $('#chatbot').append(returnedMessage)
      })
  }
      
  $('#buttonInput').click(function(){
      getUserResponse()
  })
  </code></pre>