title: compare from date is less than to date
body: <p>Hai i am developing application django where in i want to validate fromdate is less than todate.I am using the following code but it is not working</p>
  
  <p>forms.py</p>
  
  <p>class SearchFilterForm(Form):</p>
  
  <pre><code>fromdate = forms.CharField(widget=forms.TextInput(attrs={'placeholder': 'dd/mm/yy','class':'datefield','readonly':'readonly'}))
  todate = forms.CharField(widget=forms.TextInput(attrs={'placeholder': 'dd/mm/yy','class':'datefield','readonly':'readonly'}))
  </code></pre>
  
  <p>javascript:</p>
  
  <pre><code>function comparedate(){
          var fromdate = document.getElementById("id_fromdate");
          var todate = document.getElementById("id_todate");
          if(fromdate&lt;todate){
              alert("Start date should be less than end date");
          return false;
      }
  }
  </code></pre>
  
  <p>I am getting the input from date picker and the format is yy-mm-dd.The above code is not giving any error in console but it is not working.</p>