I am using Drupal Form API to upload profile image for user. I found two file upload widgets in FORM API:
'#type' => 'managed_file'&
'#type' => 'file'
managed_file requires first selecting the file, then uploading the file and then submitting the form to change the image
file requires first selecting the file and then submitting the form to change the image
What I want to do is just when you select the image file and click ok in the file browser, the form should get submitted and image should be changed.
Is it possible using FORM API? If not please recommend an alternative solution.