Search code examples
transloadit

Transloading is submitting the wrong form


I have several forms on my page that all have the class "my_form". I have activated transloadit as follows :

 $(function() {
    $('.my_form').transloadit({
      wait: true,
        triggerUploadOnFileSelection: true
      });
   });

After the files upload and the form is submittted, the wrong form is submitted. Transloadit is submitting the last form on the page with the class "my_form", rather than the specific form I submitted.

Any idea how this is happening?


Solution

  • Transloadit can't know which form you mean if you have several that match the my_form class. One way to workaround this is to give one form the attrbute id="upload_form" and then refer to that as $('#upload_form').transloadit(...etc