How do I validate if the user has selected an image or not on click of the upload button using jQuery. can i put restriction on the resolution of the image being uploaded?? eg:- only images above resolution 900 x 400 are allowed. Below is my form which i'm using
<form id='eventImage' action='upload_temp_image.php' method='POST' enctype='multipart/form-data'>
<input type='text' class='form-control' name='image_name' id='image_name'/>
<input type='file' name='event_image' id='event_image' />
<input type='submit' name='upload' value='Upload' />
</form>
Below is the jQuery:
$("#eventImage").validate({
rules: {
image_name: {
required : true
},
// validate the input type=file
},
image_name: {
new_name: "Please enter a Category name!",
event_image: "Please select an image"
}
});