Dropzone with normal form

后端 未结 1 641
日久生厌
日久生厌 2020-12-07 03:09

My problem is that I must combine a normal form with dropzone.js for a drag&drop upload. After the user clicks the submit-button, then a ajax-request send the data to a

1条回答
  •  时光说笑
    2020-12-07 03:34

    I also had the same problem but i solved it. You can checkout this link from dropzone --> https://github.com/enyo/dropzone/wiki/Combine-normal-form-with-Dropzone

    They have given what you want BUT there are some things to be added in what they have given like not making the whole form clickable and other things . The code below works fine for me

    form.html

    //remember we gave an id mydropzone to the form //this will the dropzone drag and drop section. //notice we have given it an id dropzonePreview.
    //we have given id sbmtbtn to the button

    NOTE : YOU DONT have to do any fancy stuff in the php file . Just write what you would normally write in PHP to upload files and input .

    See if this works for you.

    0 讨论(0)
提交回复
热议问题