title: how to check if input type date is empty or not using javascript or jquery
body: <p>I have the following HTML form:</p>
  
  <pre><code>&lt;form id="ChartsForm"&gt;
      &lt;div id="dateoptions"&gt;
          &lt;p&gt;Until date: &lt;input type="date" name="until_date" value="Until date"&gt;&lt;/p&gt;
          &lt;p&gt;Since date: &lt;input type="date" name="since_date" value="Since date"&gt;&lt;/p&gt;
      &lt;/div&gt;
      &lt;div class="insightsoptions"&gt;
          &lt;input id="newLikes" class="insightsbuttons" type="submit" name="submit" value="Daily new likes"&gt;
          &lt;input id="unlikes" class="insightsbuttons" type="submit" name="submit" value="Daily unlikes"&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>and the following JQuery script:</p>
  
  <pre><code>$(function () {
      $("#newLikes").one('click', function () {
          $.ajax({type:'GET', url: 'newLikes.php', data:$('#ChartsForm').serialize(), success:
              function(response) {
                  alert(response);
                  $("#dailyNewLikes").html(response);
              }});
          return false;
      });
      $("#newLikes").on('click', function(){
          $(this).toggleClass('green');
          $('#dailyNewLikes').toggle();
      });
  </code></pre>
  
  <p>How do I check if the inputs "until_date" and "since_date" are empty or not in the first place and if they are empty to stop the script before it executes the ajax call, alert the user about the mistake and then continue if the inputs are not empty anymore. I have to use <code>.one()</code>. I've tried with the .<code>blur()</code> function but with no effect...</p>