I select the document type from the select option then upload the file so how to validate in the code
<form name="file_up_form" method="post" name="fileupload" enctype="multipart/form-data">
<div class="field_container1 thumbnail span3">
<label for="select_option">Select option here</label>
<select name="doc_type" id="select_option" style="width: 200px;" multiple>
<option value="1">Education</option>
<option value="2">Certification</option>
<option value="3">Client Paperwork</option>
<option value="4">Invoice</option>
</select>
</div>
<div class="field_container thumbnail span4">
<label for="file">Upload here: </label>
<input type="file" name="file" id="file">
<input class="btn btn-primary" type="submit" value="submit" name="submit">
</div>
<input type="hidden" name="check" value="1">
</form>
Here is the validation code I'm using so far:
<script>
function validate()
{
if(document.fileupload.doc_type.value == "" && document.fileupload.doc_type.value == null)
{
alert( "Please provide your document!" );
return false;
}
if(document.fileupload.file.value == "" && document.fileupload.file.value == null)
{
alert( "Please provide your file!" );
return false;
}
return true;
}
</script>
return false;
from your code. Also make sure you use the browser console to check for any error that may be given