Js USES arrays to determine whether the same data exists for the submitted data

  • 2020-03-30 00:03:33
  • OfStack

 
var productIds = $(".productId"); 
var arry = new Array(); 
arry = productIds; 
var ary=arry.sort(); 
for(var i=0;i<ary.length-1;i++){ 
if(ary[i].value==ary[i+1].value){ 
alertMsg.confirm(" Same drug detected , Please check the !", { 
}); 
return; 
} 
} 

Related articles: