前端
弹窗+Ajax提交
Ajax提交表单
HTML
CSS
滚动条
隐藏按钮边框
圆角
JavaScrip
layui表单与图片一起提交
本文档使用MrDoc发布
返回首页
-
+
JavaScrip
2020年1月28日 10:48
admin
#获取表单值 ##form部分 <form class="layui-form layui-form-pane ok-form" id="feedBackForm" name="formdata"> {% csrf_token %} <div class="layui-form-item"> <label class="layui-form-label">公司简称</label> <div class="layui-input-block"> <input type="text" name="name" value="{{ baobei_info.name }}" class="layui-input" lay-verify="required"> </div> </div> <div class="layui-form-item layui-form-text"> <label class="layui-form-label">话术</label> <div class="layui-input-block"> <textarea name="huashu" class="layui-textarea">{{ baobei_info.huashu }}</textarea> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">业务</label> <div class="layui-input-block"> <input type="text" name="yewu" value="{{ baobei_info.yewu }}" autocomplete="off" class="layui-input" lay-verify="required"> </div> </div> <div class="layui-upload"> <button type="button" class="layui-btn" id="test2">营业执照上传</button> <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;"> <!--<div class="layui-upload-list" id="demo2"></div>--> </blockquote> </div> <div class="layui-form-item layui-form-text"> <label class="layui-form-label">经营范围</label> <div class="layui-input-block"> <textarea name="business" class="layui-textarea">{{ baobei_info.business }}</textarea> </div> </div> <div class="layui-form-item"> <div class="layui-input-block"> <button id="test9" class="layui-btn" lay-submit lay-filter="add">立即提交</button> <button type="reset" class="layui-btn layui-btn-primary">重置</button> </div> </div> </form> ##js部分 form.on('submit(add)', function(data){ #方法一:读取参数中的值 var name = data.field.name; #方法二:读取表格中的值 var huashu = document.formdata.huashu.value; #打印 console.log(huashu); })
分享到: