1

I have a managed_file form element. I want to trigger an AJAX callback when a user clicks the upload button. But I can't seem to get anything working by attaching the #ajax element to the managed_file element. I know the managed_file element creates an upload button automatically, so I tried to hook into that using hook_form_alter but the button doesn't seem to have been created yet, so I can't attach the AJAX handler.

Any ideas?

3

No, unfortunately, you can't use #ajax because managed_file uses it internally for its own purposes.

| improve this answer | |
  • Is there any way to it's internal ajax?? – Sugandh Khanna Dec 22 '15 at 8:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.