简体   繁体   English

PHP 表单,使用 adminlte - DropZone js 输入文本和图像

[英]PHP form with text and image inputs using adminlte - DropZone js

I am using a template from adminLTE( https://adminlte.io/themes/v3/pages/forms/advanced.html ) you can see it at the end of the page, I want to just upload images first and pass the image name as one of the input text elements to my main form to pass them when submitted the final form.我正在使用来自 adminLTE 的模板( https://adminlte.io/themes/v3/pages/forms/advanced.html )您可以在页面末尾看到它,我只想先上传图片并传递图片name 作为我的主表单的输入文本元素之一,以便在提交最终表单时传递它们。

  1. But dropzone is restricting to use the form tag to upload photos, we cannot use form isnide another form但是dropzone限制使用form标签上传照片,我们不能使用form iside另一个form
  2. I have no other option than this除了这个我别无选择

Could anyone help me with the idea on how to implement this in PHP or using js and html?谁能帮助我了解如何在 PHP 或使用 js 和 html 中实现这一点? or any reference?或任何参考?

This automatically uploads images without submitting the form.这会自动上传图像而不提交表单。

var myDropzone = new Dropzone(document.body, {
    url: "upload.php", // this url change. upload.php only image upload.
    thumbnailWidth: 80,
    thumbnailHeight: 80,
    parallelUploads: 20,
    previewTemplate: previewTemplate,
    autoQueue: true, // and this change true.
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM