I am trying to do jquery validation on file upload for file is select or not. I want when user click on upload before submit check file is selected or not. if not stop ajax request. Any Idea to validate it?
$videoForm['profile_photos']['images']['field_photo'] = array(
'#parents' => array('video', 'field_photo'),
'#id' => 'field_photo',
'#type' => 'managed_file',
'#title' => 'Photo <em>(optional)</em>',
'#field_name' => 'field_photo',
'#process' => array(
'm_customer_profile_image_remove',
'm_customer_profile_image_upload',
'file_managed_file_process',
'customer_profile_image_preview',
),
'#upload_location' => 'public://' . $user->uid,
'#limit_validation_errors' => array(array('video', 'field_photo')),
'#upload_validators' => array(
'file_validate_size' => array(64*1024*1024),
'file_validate_extensions' => array('gif jpeg jpg png')
)
);