<div class='layui-form-item'> <label class='layui-form-label'>各分项数量<span class="required-field"></span></label> <div class='layui-input-block'> <div class='layui-inline'> <input type='text' name='vcFxsl1' id='vcFxsl1' placeholder='请输入分项数量1' class='layui-input' lay-verify='required' maxlength="8" /> </div> <div class='layui-inline'> <input type='text' name='vcFxsl2' id='vcFxsl2' placeholder='请输入分项数量2' class='layui-input' lay-verify='required' maxlength="8" /> </div> <div class='layui-inline'> <input type='text' name='vcFxsl3' id='vcFxsl3' placeholder='请输入分项数量3' class='layui-input' lay-verify='required' maxlength="8" /> </div> </div> </div> 把三个输入框修改为 上下箭头选择数字 0-99
时间: 2024-04-14 21:27:24 浏览: 104
你可以使用`layui`的下拉选择框来替换文本输入框,让用户从上下箭头中选择数字0-99。下面是修改后的代码示例:
```html
<div class='layui-form-item'>
<label class='layui-form-label'>各分项数量<span class="required-field"></span></label>
<div class='layui-input-block'>
<div class='layui-inline'>
<select name='vcFxsl1' id='vcFxsl1' lay-verify='required'>
<option value=''>请选择分项数量1</option>
<!-- 生成数字选项 -->
<option value='0'>0</option>
<option value='1'>1</option>
<!-- 依此类推,生成99个选项 -->
<option value='99'>99</option>
</select>
</div>
<div class='layui-inline'>
<select name='vcFxsl2' id='vcFxsl2' lay-verify='required'>
<option value=''>请选择分项数量2</option>
<!-- 生成数字选项 -->
<option value='0'>0</option>
<option value='1'>1</option>
<!-- 依此类推,生成99个选项 -->
<option value='99'>99</option>
</select>
</div>
<div class='layui-inline'>
<select name='vcFxsl3' id='vcFxsl3' lay-verify='required'>
<option value=''>请选择分项数量3</option>
<!-- 生成数字选项 -->
<option value='0'>0</option>
<option value='1'>1</option>
<!-- 依此类推,生成99个选项 -->
<option value='99'>99</option>
</select>
</div>
</div>
</div>
```
这样,用户就可以从下拉选择框中选择数字0-99作为各分项的数量。记得根据实际需求修改每个下拉选择框的`name`和`id`属性。
阅读全文