anchor.diff:                                          <input id="4" name="details[][quantity]:number" placeholder="采购数量" type="number" style="line-height: 28px" required>&nbsp;&nbsp;&nbsp;&nbsp;
                                           <input id="5" name="details[][unit]" placeholder="采购单位" data-validate-length-range="1,6" type="text" required>&nbsp;&nbsp;&nbsp;&nbsp;<br>
                                           <input type="text" id="text2" name="text2" placeholder="供应商" style="width:340px;margin-top:6px" required />
  -                                        <input type="hidden" id="details[]supplier[id]" name="details[]supplier[id]">
  +                                        <input type="hidden" id="details[][supplier[id]]" name="details[][supplier[id]]:number">
                                        </div>
                                        </c:if>
  +                                    <c:set var="cursor" value="0" />
                                       <c:forEach items="${entity.details}" var="detail" varStatus="status">
                                           <div id="detail" class="row">
  -                                            <input id="${status.count}1" name="details[][productName]" value="${detail.productName}" placeholder="商品名称" data-validate-length-range="6,30" data-validate-words="1" type="text" style="width:240px" required>&nbsp;&nbsp;&nbsp;&nbsp;
  -                                            <input id="${status.count}2" name="details[][amount]:number" value="${detail.amount}" placeholder="采购金额" type="number" style="line-height: 28px" required>&nbsp;&nbsp;&nbsp;&nbsp;
  -                                            <input id="${status.count}3" name="details[][price]:number" value="${detail.price}" placeholder="采购单价" type="number" style="line-height: 28px" required>&nbsp;&nbsp;&nbsp;&nbsp;
  -                                            <input id="${status.count}4" name="details[][quantity]:number" value="${detail.quantity}" placeholder="采购数量" type="number" style="line-height: 28px" required>&nbsp;&nbsp;&nbsp;&nbsp;
  -                                            <input id="${status.count}5" name="details[][unit]" value="${detail.unit}" placeholder="采购单位" data-validate-length-range="1,6" type="text" required>&nbsp;&nbsp;&nbsp;&nbsp;<br>
  -                                            <input type="text" id="${status.count}text2" name="text2" value="${detail.supplier.name}" placeholder="供应商" style="width:340px;margin-top:6px" required />
  -                                            <input type="hidden" id="${status.count}details[]supplier[id]" value="${detail.supplier.id}" name="details[]supplier[id]">
  +                                            <input id="1<c:if test="${status.count > 1}">${status.count-1}</c:if>" name="details[][productName]" value="${detail.productName}" placeholder="商品名称" data-validate-length-range="6,30" data-validate-words="1" type="text" style="width:240px" required>&nbsp;&nbsp;&nbsp;&nbsp;
  +                                            <input id="2<c:if test="${status.count > 1}">${status.count-1}</c:if>" name="details[][amount]:number" value="${detail.amount}" placeholder="采购金额" type="number" style="line-height: 28px" required>&nbsp;&nbsp;&nbsp;&nbsp;
  +                                            <input id="3<c:if test="${status.count > 1}">${status.count-1}</c:if>" name="details[][price]:number" value="${detail.price}" placeholder="采购单价" type="number" style="line-height: 28px" required>&nbsp;&nbsp;&nbsp;&nbsp;
  +                                            <input id="4<c:if test="${status.count > 1}">${status.count-1}</c:if>" name="details[][quantity]:number" value="${detail.quantity}" placeholder="采购数量" type="number" style="line-height: 28px" required>&nbsp;&nbsp;&nbsp;&nbsp;
  +                                            <input id="5<c:if test="${status.count > 1}">${status.count-1}</c:if>" name="details[][unit]" value="${detail.unit}" placeholder="采购单位" data-validate-length-range="1,6" type="text" required>&nbsp;&nbsp;&nbsp;&nbsp;<br>
  +                                            <input type="text" id="text2<c:if test="${status.count > 1}">${status.count-1}</c:if>" name="text2" value="${detail.supplier.name}" placeholder="供应商" style="width:340px;margin-top:6px" required />
  +                                            <input type="hidden" id="details[][supplier[id]]<c:if test="${status.count > 1}">${status.count-1}</c:if>" value="${detail.supplier.id}" name="details[][supplier[id]]:number">
                                           </div>
  +                                        <c:set var="cursor" value="${status.count-1}" />
                                       </c:forEach>
                                   </div></div>
                               </div>
  
positive.code: 
          document.getElementById("1" + count).focus();
  
          $(":input[name='text2']").coolautosuggest({
              url:"<%=request.getContextPath()%>/erp/suggest/supplier/name/",
              showProperty: 'name',
              onSelected:function(result){
                  if(result!=null){
                      $(document.getElementById("charger[id]")).val(result.id);
                  }
              }
          });
  
negative.code:         }
      });
  
      $("#text2").coolautosuggest({
          url:"<%=request.getContextPath()%>/erp/suggest/supplier/name/",
          showProperty: 'name',
          onSelected:function(result){
              if(result!=null){
                  $(document.getElementById("details[][supplier[id]]")).val(result.id);
              }
          }
      });
  