网站表单里面 图片专用字段出现错误

迅睿框架 更新 2024-12-08 01:39:24 大白菜慢慢学

网站表单里面 图片专用字段,从系统自带模块代码复制出来,自定义了个模板放进去后出现;

1733564940308

代码如下:


<script type="text/javascript">$(function(){$("#my-dropzone-baomingzhao").sortable();Dropzone.autoDiscover=false;$("#my-dropzone-baomingzhao").dropzone({addRemoveLinks:true,maxFiles:99999,maxFilesize:5,acceptedFiles:"image/*",dictMaxFilesExceeded:"最多只能上传1张图片(可在自定义字段中设置本字段的个数值)",dictResponseError:'文件上传失败',dictInvalidFileType:"不能上传该类型文件",dictFallbackMessage:"浏览器不受支持",dictFileTooBig:"文件过大上传文件最大支持",url:"/index.php?s=api&c=file&token=7ddf5a9f31b65823455d4c30b8a1510a&siteid=1&m=upload&p=5b009e0196ca677a4370d1beee32d2ac&fid=76",init:function(){this.on("addedfile",function(file){var activeFiles=this.getActiveFiles();var num=parseInt($(".dr_dropzone_baomingzhao_total").val());if(num+activeFiles.length+1>1){this.options.maxFiles=-1}});this.on("success",function(file,res){var rt=JSON.parse(res);if(rt.code){var num=parseInt($(".dr_dropzone_baomingzhao_total").val());$(".dr_dropzone_baomingzhao_total").val(num+1);var input='<input class="dr_dropzone_baomingzhao" type="hidden" name="data[baomingzhao][]" value="'+rt.id+'" />';$(file.previewElement).append(input)}else{dr_tips(0,rt.msg);file.previewElement.classList.remove("dz-success");file.previewElement.classList.add("dz-error");file.previewElement.classList.add("dz-error")}})}});$("#my-dropzone-baomingzhao").append("<input class=\"dr_dropzone_baomingzhao_total\" type=\"hidden\" value=\"0\" />")});function dr_delete_image_baomingzhao(e){var num=parseInt($(".dr_dropzone_baomingzhao_total").val());$(".dr_dropzone_baomingzhao_total").val(num-1);$("#image-baomingzhao-"+e).remove()}</script>

<audio controls="controls" style="display: none;"></audio>

方案

  • 平淡人生 #1 · 2024-12-07 21:29:11
    满意答案
    ){$("改成 ){ 空格 $("
  • 大白菜慢慢学 #2 · 2024-12-08 01:39:24
    @平淡人生:,成功解决了问题

迅睿系统漏洞

GeoSeo收录宝
GeoSeo收录宝(2026-09-01)
升级 ai智能发布功能 升级 支持8国语言后端设置和前端输出功能 ...
Word发布批量上传
Word发布批量上传(2026-08-31)
版本覆盖问题重发
多语言翻译Seolang
多语言翻译Seolang(2026-08-31)
新增 LLM 大模型对话翻译模块 配置层强类型化重构 URL 模...
自定义存储
自定义存储(2026-08-30)
同步服务器端通用版实现,统一管理端、CMS 端和浏览器直传的提示与错...
GeoSeo工具箱
GeoSeo工具箱(2026-08-29)
新增 bing推送 新增 IndexNow推送 新增 baidu...
外贸多语言建站
外贸多语言建站(2026-08-27)
新增阿里云专业版入口 新增阿里云自动识别字符格式
Querylist渐进式采集
Querylist渐进式采集(2026-08-26)
增加范围截取规则
实时任务
实时任务(2026-08-26)
补充并整理完整使用说明、历史版本更新日志,统一帮助页样式。