【发布时间】:2016-03-20 12:09:21
【问题描述】:
当您将鼠标悬停在 Dropzone 中丢弃的文件中的“X”上时,我正在尝试输出表单验证错误。
我得到了什么:
如何使object Object 输出来自表单验证的实际错误消息?我可以提醒错误消息,但实际上无法在将鼠标悬停在 x 上时显示错误消息。
我的js文件:
Dropzone.options.fileupload = {
maxFilesize: 20,
init: function () {
thisDropzone = this;
this.on("error", function (file, responseText) {
$.each(responseText, function (index, value) {
alert( value); //this shows the alert of the error message
});
});
}
};
我的控制器:
$this->validate($request, [
'file' => 'max:20000',
]);
【问题讨论】:
-
对于任何寻求解决方案的人,请查看 stackoverflow.com/a/66603779/5723524
标签: javascript php jquery laravel dropzone.js