问题遇到的现象和发生背景
表单内容都填了提交,结果提示必选项不能为空,不知道哪里出了问题,编辑商品也是差不多一样的代码但是可以编辑
问题相关代码,请勿粘贴截图
<div class="layui-form-item">
<label class="layui-form-label">商品名称</label>
<div class="layui-input-block">
<input type="text" name="productname" id="productname" lay-verify="required" style="width: 300px;" autocomplete="off" class="layui-input" placeholder="商品名称" >
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">图片</label>
<div class="layui-input-block">
<input name='filename' type='text' class="layui-input" lay-verify="required" style="width: 300px;" id='url' size='50' value='' /> <input type='button' value='上传' class="layui-input" onClick="up('url')" style="width: 60px;height: 37px;"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">商品一级类别</label>
<div class="layui-input-block" style="width: 300px;">
<select name="fid" id="fid" style="width: 300px;" onChange="Change_Select()" lay-verify="required" lay-filter="fid" autocomplete="off" class="layui-input">
<option value="">请选择类别</option>
<c:forEach items="${list}" var="fcategory">
<option value="${fcategory.id}">${fcategory.name}</option>
</c:forEach>
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">商品二级类别</label>
<div class="layui-input-block" style="width: 300px;">
<select name="cid" id="cid" style="width: 300px;" lay-verify="required" lay-filter="cid" autocomplete="off" class="layui-input">
<option value="">请选择上一级类别</option>
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">商品三级类别</label>
<div class="layui-input-block" style="width: 300px;">
<select name="mid" id="mid" style="width: 300px;" lay-verify="required" lay-filter="mid" autocomplete="off" class="layui-input" >
<option value="">请选择上一级类别</option>
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">商品单价</label>
<div class="layui-input-block">
<input type="text" name="price" id="price" required oninvalid="setCustomValidity('商品单价不能为空或价格输入有误')" oninput="setCustomValidity('');" pattern="(0|[1-9][0-9]{0,9})(\.[0-9]{1,2})?" style="width: 300px;" autocomplete="off" class="layui-input" placeholder="商品单价" >
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">材质</label>
<div class="layui-input-block">
<input type="text" name="author" id="author" lay-verify="required" oninvalid="setCustomValidity('材质不能为空')" oninput="setCustomValidity('');" style="width: 300px;" autocomplete="off" class="layui-input" placeholder="材质" >
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">发货地</label>
<div class="layui-input-block">
<input type="text" name="press" id="press" lay-verify="required" oninvalid="setCustomValidity('发货地不能为空')" oninput="setCustomValidity('');" style="width: 300px;" autocomplete="off" class="layui-input" placeholder="发货地" >
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">商品介绍</label>
<div class="layui-input-block">
<textarea id="editor_id" name="content" style="width: 600;height: 280px;" placeholder="请输入商品介绍" lay-verify="required" class="layui-textarea" oninvalid="setCustomValidity('商品介绍不能为空')" oninput="setCustomValidity('');" ></textarea>
</div>
</div>
<div class="layui-form-item change-submit">
<div class="layui-input-block">
<button class="layui-btn" lay-submit="" id="supplierbutton" lay-filter="demo1" >立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
</div>
</div>