增加导航条index的输入限制

This commit is contained in:
呱呱呱 2023-09-27 10:28:33 +08:00
parent 19c8587723
commit b080b8fca5
2 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
<tr>
<td><%= text_field_tag('navbar[][name]', "", id: nil, class: 'form-control', placeholder: "导航名称") %></td>
<td><%= text_field_tag('navbar[][link]', "", id: nil, class: 'form-control', placeholder: "导航链接") %></td>
<td><%= number_field_tag('navbar[][index]', "", id: nil, class: 'form-control', placeholder: "顺序") %></td>
<td><%= number_field_tag('navbar[][index]', "1", id: nil, class: 'form-control',min:0, max:99999, placeholder: "顺序", title:"请输入正整数 范围 0-99999", pattern:'^\d+')%></td>
<td class="text-center">
<%= check_box_tag('navbar[][hidden]', 0, false, id: nil, class: 'font-16') %>
</td>

View File

@ -158,8 +158,8 @@
<thead class="thead-light">
<tr>
<th width="30%">导航名称</th>
<th width="50%">导航链接</th>
<th width="5%">顺序</th>
<th width="30%">导航链接</th>
<th width="15%">顺序</th>
<th width="5%" class="text-center">是否展示</th>
<th width="10%" class="text-center">操作</th>
</tr>
@ -169,7 +169,7 @@
<tr>
<td><%= text_field_tag('navbar[][name]', nav['name'], id: nil, class: 'form-control') %></td>
<td><%= text_field_tag('navbar[][link]', nav['link'], id: nil, class: 'form-control') %></td>
<td><%= number_field_tag('navbar[][index]', nav['index'], id: nil, class: 'form-control') %></td>
<td><%= number_field_tag('navbar[][index]', nav['index'].to_i, id: nil, class: 'form-control',min:0,max:99999, title:"请输入正整数 范围 0-99999", pattern:'^\d+')%></td>
<td class="text-center">
<%= check_box_tag('navbar[][hidden]', 0, !nav['hidden'], id: nil, class: 'font-16') %>
</td>