title: validation startdate and enddate codeigniter
body: <p>i want to validate 2 date input in codeigniter, with the conditions, if the end date is greater than the start date, will appear warning [javascript warning or something] or data can't be input</p>
  
  <p>my form like this, </p>
  
  <pre><code>&lt;h1&gt;&lt;?php echo $title; ?&gt;&lt;/h1&gt;
  &lt;form action="&lt;?= base_url(); ?&gt;index.php/admin/kalender/buat" method="post" enctype="multipart/form-data" name="form" id="form"&gt;
  &lt;?php
  echo "&lt;p&gt;&lt;label for='IDKategori'&gt;Tingkatan Pimpinan :&lt;/label&gt;&lt;br/&gt;";
  echo form_dropdown('IDKategori', $kategori) . "&lt;/p&gt;";
  
  echo "&lt;label for='ptitle'&gt;Kegiatan / Lokasi :&lt;/label&gt;&lt;br/&gt;";
  $data = array('class' =&gt; 'validate[required] text-input', 'name' =&gt; 'judul', 'id' =&gt; 'ptitle', 'size' =&gt; 80);
  echo form_input($data);
  
  echo "&lt;p&gt;&lt;label for='long'&gt;Uraian Kegiatan / Keterangan / Catatan :&lt;/label&gt;&lt;br/&gt;";
  $data = array('class' =&gt; 'validate[required] text-input', 'name' =&gt; 'konten', 'rows' =&gt; '13', 'cols' =&gt; '60', 'style' =&gt; 'width: 60%');
  echo form_textarea($data) . "&lt;/p&gt;";
  
  echo "&lt;p&gt;&lt;label for='ptitle'&gt;Waktu Mulai :&lt;/label&gt;&lt;br/&gt;";
  $data = array('class' =&gt; 'validate[required] text-input', 'name' =&gt; 'TanggalMulai', 'id' =&gt; 'basic_example_1');
  echo form_input($data) . "&lt;/p&gt;";
  
  echo "&lt;p&gt;&lt;label for='ptitle'&gt;Waktu Akhir :&lt;/label&gt;&lt;br/&gt;";
  $data = array('class' =&gt; 'validate[required] text-input', 'name' =&gt; 'TanggalAkhir', 'id' =&gt; 'basic_example_2');
  echo form_input($data) . "&lt;/p&gt;";
  
  echo form_submit('submit', 'Tambah Even');
  ?&gt;
  &amp;nbsp;&amp;nbsp;&lt;input type="button" value="Kembali" onClick="javascript: history.go(-1)" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>and my javascript like this, </p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;$(document).ready(function() {
      $.validator.addMethod("TanggalAkhir", function(value, element) {
          var startDate = $('.TanggalMulai').val();
          return Date.parse(startDate) &lt;= Date.parse(value) || value == "";
      }, "* End date must be after start date");
      $('#form').validate();
  });
  </code></pre>
  
  <p></p>
  
  <p>why is not working ?</p>