title: Check file type when form submit?
body: <p>I have the form having the follwing fields,</p>
  
  <pre><code>&lt;form onsubmit="return checkcreateform()" action="/gallery/create" method="post" enctype="multipart/form-data"&gt;
     &lt;label&gt;Type:*&lt;/label&gt;
      &lt;label for="type-1"&gt;
       &lt;input type="radio" checked="checked" value="1" id="type-1" name="type"&gt;Image
      &lt;/label&gt;
     &lt;br&gt;
     &lt;label for="type-2"&gt;
     &lt;input type="radio" value="2" id="type-2" name="type"&gt;Video
     &lt;/label&gt;  
     &lt;label class="itemdetailfloatL required" for="file"&gt;File:*&lt;/label&gt;
     &lt;input type="hidden" id="MAX_FILE_SIZE" value="8388608" name="MAX_FILE_SIZE"&gt;
     &lt;input type="file" tabindex="5" class="text-size text" id="file" name="file"&gt;
   &lt;input type="submit" value="Create" id="submit" name="submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I want to validate before form submit. Here how can  i validate if user select type as Image and upload video or select type as video and upload image ?</p>
  
  <p>We can achieve this by javascript or jquery.Any quick way to validate this ?</p>
  
  <p>Kindly help me on this.</p>