Hello.(Sorry for my bad English)

I’m building multi steps form with help of FAPI in front-end section.
In the final step of my form I want use some third party js libraries for few task (like uploading file). But my problems begin here.
How wrap these js libraries to the FAPI and make ajax callback function. This libraries make dynamic elements and I don’t know how connect theirs event to FAPI system.
(Plupload is good example of this js libraries that create dynamic upload button )
I know already that I can use default #ajax callback, but this is for predefined elements like textbox, button,… in FAPI system.

My first idea (didn’t work): deceive drupal FAPI
I get form_id and form_build_id of my form with help of jQuery and make ajax post to q=system/ajax url. But drupal make new form and reset form_state of my old form.

My second idea (I don’t know how implement it): make custom FAPI element for each js library and used it on form. I’m familiar with _element_info hook but unfortunately for complex library like plupload it’s hard for me to accomplish this.

###
https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.h...
http://www.plupload.com/

Comments

jaypan’s picture

Your second idea is how you would do it.

Contact me to contract me for D7 -> D10/11 migrations.