This is a trivial question, but for some reason I am having trouble with it.
I have HTML for uploading a file such as the following.
<input type="file" name="settings">
And all I need to do is check when the form is submitted that a value has been selected. I dont need help with the code for the form submission, I just need help since I am guessing you are unable to validate this as you would other form input fields such as text boxes.
I have tried doing things like...
var file = document.getElementById('settings').value;
if(file.length > 0 == false){
//give error messsage here
I know that there should be an easy fix for this but I cant quite figure it out.
Thanks