Timeline for How do I add an #ajax callback to File field form widget?
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 14, 2016 at 20:33 | comment | added | user3421014 | Can I add additional submit handler for Submit file button and somehow to update another field with javascript ? | |
Nov 14, 2016 at 16:58 | comment | added | Beebee |
Oh and you should probably use hook_field_widget_form_alter to do the above (comment) instead of plain hook_form_alter
|
|
S Nov 14, 2016 at 16:56 | history | edited | Beebee | CC BY-SA 3.0 |
Further edits to improve the meaning
|
S Nov 14, 2016 at 16:56 | history | suggested | acrosman | CC BY-SA 3.0 |
Copy edits for clarity.
|
Nov 14, 2016 at 16:51 | comment | added | Beebee |
there's no change method. Perhaps you meant to put that as event ? Also, as to your main question, take a look at the core file module (file.field.inc specifically). There's a #process function that gets added on the file widget, which changes the #ajax array's values, effectively after everytime you upload an image. So you may need to add your own #process function into that array, and add your #ajax there. I've never done this before though. Hence just commenting.
|
|
Nov 14, 2016 at 16:30 | review | Suggested edits | |||
S Nov 14, 2016 at 16:56 | |||||
Nov 14, 2016 at 13:49 | history | asked | user3421014 | CC BY-SA 3.0 |