Javascript Dropzone未在窗体内显示自身
我试图有一个输入和一个图像/文件上传器的形式,所以它得到所有上传后,我按下提交按钮 但是当我将dropzone(PreviewContainer)放入表单中时,它并没有显示自己 HTMLJavascript Dropzone未在窗体内显示自身,javascript,jquery,dropzone.js,Javascript,Jquery,Dropzone.js,我试图有一个输入和一个图像/文件上传器的形式,所以它得到所有上传后,我按下提交按钮 但是当我将dropzone(PreviewContainer)放入表单中时,它并没有显示自己 HTML 尼美图斯 图普 @foreach($type作为$type) {{$type->name} @endforeach 啊 泰利贾 信息 阿瓦利克。 PildijaFailid 继续 剧本 {{HTML::script(“js/jquery-1.9.1.js”)} {{HTML::script(“js/jque
尼美图斯
图普
@foreach($type作为$type)
{{$type->name}
@endforeach
啊
泰利贾
信息
阿瓦利克。
PildijaFailid
继续
剧本
{{HTML::script(“js/jquery-1.9.1.js”)}
{{HTML::script(“js/jquery-ui-1.9.2.custom.min.js”)}
{{HTML::style('css/basic.css');}
{{HTML::style('css/dropzone.css');}
{{HTML::script('js/dropzone.js')}
Dropzone.autoDiscover=false;//如果这是真的,我会在控制台中得到“URL未定义”。
$(文档).ready(函数(){
Dropzone.options.myAwesomeDropzone={//表单元素ID的简化版本
//我们上面讨论过的配置
url:“#”,
PreviewContainer:“.dropzone预览”,
自动处理队列:false,
uploadMultiple:true,
并行上传:100,
最大文件数:100,
//dropzone的设置
init:function(){
var myDropzone=this;
console.log(myDropzone);//当我检查时,这不会被记录。似乎dropzone.js只在div id的camellized版本位于类dropzone内时才检测到它
修理
HTML
这现在起作用了。
我的问题中的代码需要重做一点,但我决定采取另一种方法,这也会起作用,因此我缩短了代码。没有提供URL是我遇到的错误。我将ID添加到我的表单(myForm)中,然后将表单的ID添加到配置URL:“#myForm”
中的URL中,但错误仍然相同“没有提供URL”。你能帮我解决这个问题吗?我也想过这样做,但它不起作用。没有显示错误…只有php中的$\uu文件显示为空
<form action="#" class="giga-form" id="my-awesome-dropzone">
<div class="col-md-5">
<h5>nimetus</h5>
<input class="form-control" type="text" required>
<h5>tüüp</h5>
<select class="form-control" required>
@foreach($types as $type)
<option value="{{$type->id}}">{{$type->name}}</option>
@endforeach
</select>
<h5>aadress</h5>
<input class="form-control" type="text">
<h5>tellija</h5>
<input class="form-control" type="text">
<h5>info</h5>
<textarea class="form-control" rows="3"></textarea>
</div>
<div class="col-md-6 col-md-offset-1 top-pad">
<div class="ico-border"><i class="icon-unlock"></i></div> avalik. <a href="#"><b>Varja</b></a>
<h5 class="top-br">pildid ja failid</h5>
<div class="giga-table fixed thumbnails dropzone">
<div class="dropzone-previews"></div>
</div>
</div>
<button type="submit">Continue</button>
</form>
{{ HTML::script("js/jquery-1.9.1.js") }}
{{ HTML::script("js/jquery-ui-1.9.2.custom.min.js") }}
{{ HTML::style('css/basic.css');}}
{{ HTML::style('css/dropzone.css');}}
{{ HTML::script('js/dropzone.js') }}
<script>
Dropzone.autoDiscover = false; // if this is true I get "URL not defined" in console.
$(document).ready(function(){
Dropzone.options.myAwesomeDropzone = { // The camelized version of the ID of the form element
// The configuration we've talked about above
url: '#',
previewsContainer: ".dropzone-previews",
autoProcessQueue: false,
uploadMultiple: true,
parallelUploads: 100,
maxFiles: 100,
// The setting up of the dropzone
init: function() {
var myDropzone = this;
console.log(myDropzone); // This doesn't get logged when I check. <-------
// First change the button to actually tell Dropzone to process the queue.
this.element.querySelector("button[type=submit]").addEventListener("click", function(e) {
// Make sure that the form isn't actually being sent.
e.preventDefault();
e.stopPropagation();
myDropzone.processQueue();
});
// Listen to the sendingmultiple event. In this case, it's the sendingmultiple event instead
// of the sending event because uploadMultiple is set to true.
this.on("sendingmultiple", function() {
// Gets triggered when the form is actually being sent.
// Hide the success button or the complete form.
});
this.on("successmultiple", function(files, response) {
// Gets triggered when the files have successfully been sent.
// Redirect user or notify of success.
});
this.on("errormultiple", function(files, response) {
// Gets triggered when there was an error sending the files.
// Maybe show form again, and notify user of error
});
}
}
});
</script>
<div class="dropzone dropzone-previews" id="my-awesome-dropzone"></div>
$(document).ready(function(){
Dropzone.options.myAwesomeDropzone = { // The camelized version of the ID of the form element
// The configuration we've talked about above
url: '#',
previewsContainer: ".dropzone-previews",
uploadMultiple: true,
parallelUploads: 100,
maxFiles: 100
}
});