解决方案 »

  1.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>无标题文档</title>
        <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
    </head>
    <body>
    <script type="text/javascript">
        function jc(){
            var inValue = new Array();
            $("input[name='currtQutar']").each(function(){
                
                if($.inArray($(this).val(),inValue) != -1){
                    alert("已经存在该值:"+$(this).val());
                }else{
                    inValue.push($(this).val());
                }
            })
            console.log(inValue)
        }
    </script>
      <input type='text' name="currtQutar" value="currtQutar" /><input type='text' name="currtQutar" value="currtQutar"/><input type='text' name="currtQutar" value="currtQutar1"/><input type='text' name="currtQutar" value="currtQutar2"/><input type="button" onclick="jc();" value="检查" />
    </body>
    </html>
      

  2.   

    遍历每个文本的value 放进一个对象直接量里 key是文本的value 值是1 放之前检测下这个对象对应的key的值试试