$(document).ready(function(e) { $(".indexvideobtn").click(function(){ $(".indexvideo").fadein('fast'); }); $(".indexvideoclose").click(function(){ $(".indexvideo").fadeout('fast'); }); $(".fenggeselectp").click(function(){ $(this).find(".fenggeselectc").show(); }).mouseleave(function(){ $(this).find(".fenggeselectc").hide(); }); $(".fenggeselectc li").click(function(){ var lival=$(this).html(); $(".fenggeselectd span").html(""); $(":input[name=usertype]").val(""); if(lival.trim()=="用户自填写"){ $("#usertypediv").show(); }else{ $(":input[name=usertype]").val(lival); $("#usertypediv").hide(); $(".fenggeselectd span").html(lival); } $(".fenggeselectc").hide(); }); $(".fenggeselectc li").mouseover(function(){ $(this).css("background-color","#f8df9e"); }).mouseleave(function(){ $(this).css("background-color",""); }); $("#userregform").submit(function(){ if($(this).find("select[name=usertype1]").length>0){ if($(this).find(":input[name=usertype1]").val()==""){ alert("请选择用户行业类别"); return false; } if($(this).find(":input[name=usertype2]").val()==""){ alert("请选择用户类别"); return false; } }else{ if($(":radio[name=usertype2]:checked").length<=0){ alert("请选择用户类别"); return false; } } if($(":checkbox[name=usetype]:checked").length<=0){ alert("请选择选型用途"); return false; } if($(this).find(":input[name=company]").val()==""){ alert("请输入咨询个人、公司全称"); return false; } if($(this).find(":input[name=name]").val()==""){ alert("请输入姓名"); return false; } if($(this).find(":input[name=mobile]").val()==""){ alert("请输入手机"); return false; } if(checkmobile($(this).find(":input[name=mobile]").val())==false){ alert("请输入正确的手机号码"); return false; } if($(this).find(":input[name=email]").val()!=""){ if(checkmail($(this).find(":input[name=email]").val())==false){ alert("请输入正确的邮箱地址"); return false; } } }); $("#editpwdform").submit(function(){ var founderr=false; if($("#oldpwd").val()==""){ $("#oldpwd").parent().find("span").html("请输入原密码"); founderr=true; }else{ $("#oldpwd").parent().find("span").html(""); } if($("#password").val()==""){ $("#password").parent().find("span").html("请输入新密码"); founderr=true; }else{ $("#password").parent().find("span").html(""); } if($("#password2").val()==""){ $("#password2").parent().find("span").html("请输入确认密码"); founderr=true; }else{ $("#password2").parent().find("span").html(""); } if($("#password2").val()!=$("#password").val()){ $("#password2").parent().find("span").html("两次密码输入不一致,请重新输入"); founderr=true; }else{ $("#password2").parent().find("span").html(""); } if(founderr==true) return false; }); $("#jiegou").change(function(){ var jiegouval=$(this).val(); $(".xuankuang").html(""); $("#jiegoup2").html(""); $("#jiegoup3").html(""); switch(parseint(jiegouval)){ case 1 : $("#jiegoup2").html("吸上高度(泵到液面距离)"); break; case 2: $(".xuankuang").html(""); break; case 3: $("#jiegoup2").html(""); break; case 5: $("#jiegoup2").html(""); $("#jiegoup3").html("液下深度"); break; case 6: $("#jiegoup2").html(""); break; } }); $("#quickselectform").submit(function(e){ if($(":input[name=proname]").val()==""){ alert("请输入关键词"); $(":input[name=proname]").focus(); return false; } $.post("quickselect_data.asp",{proname:$(":input[name=proname]").val()},function(data){ $("#quickselect_data").html(data); }); e.preventdefault(); }); $("#qcsbtn1").live('click',function(){ $("#qcsdiv").show(); }); $("#qcsbtn2").live('click',function(){ window.location.reload(); }); $("#select2formbtn").click(function(e){ /* if($(":input[name=jzcf1]").val()=="" && $(":input[name=jzcf2]").val()=="" && $(":input[name=jzcf3]").val()=="" && $(":input[name=jzcf4]").val()==""){ alert("介质成份至少填写一项"); return false; } */ if($(":input[name=jzcf1]").val()!=""){ if($(":input[name=jzcfhl1]").val()==""){ alert("请填写该介质的浓度"); $(":input[name=jzcfhl1]").focus(); return false; } } if($(":input[name=jzcf2]").val()!=""){ if($(":input[name=jzcfhl2]").val()==""){ alert("请填写该介质的浓度"); $(":input[name=jzcfhl2]").focus(); return false; } } if($(":input[name=jzcf3]").val()!=""){ if($(":input[name=jzcfhl3]").val()==""){ alert("请填写该介质的浓度"); $(":input[name=jzcfhl3]").focus(); return false; } } if($(":input[name=jzcf4]").val()!=""){ if($(":input[name=jzcfhl4]").val()==""){ alert("请填写该介质的浓度"); $(":input[name=jzcfhl4]").focus(); return false; } } if($(":input[name=hanguliang]:checked").val()=="含杂质"){ if($(":input[name=zazhirongdu]").val()==""){ alert("请填写该杂质体积浓度"); $(":input[name=zazhirongdu]").focus(); return false; } } if($(":input[name=temp_l]").val()==""){ alert("请填写使用温度"); $(":input[name=temp_l]").focus(); return false; } if($(":input[name=temp_u]").val()==""){ alert("请填写使用温度"); $(":input[name=temp_u]").focus(); return false; } if($(":input[name=fengmi]:checked").length<=0){ alert("请选择密封形式"); return false; } if($(":input[name=jiegou]").val()==""){ alert("请选择结构形式"); $(":input[name=jiegou]").focus(); return false; } if($("select[name=woshicldname]").length>0){ if($("select[name=woshicldname]").val()==''){ alert("请选择卧式离心泵结构形式"); $(":input[name=woshicldname]").focus(); return false; } } if($(":input[name=bcl]:checked").length<=0){ alert("请选择泵材质"); return false; } if($(":input[name=liuliang]").val()==""){ alert("请输入流量"); $(":input[name=liuliang]").focus(); return false; } if($(":input[name=yangcheng]").val()==""){ alert("请选择杨程"); $(":input[name=yangcheng]").focus(); return false; } $("#selectlist").html(""); $.post("select2do.asp",$("#select2form").serialize(),function(data){ $("#selectlist").html(data); }); e.preventdefault(); }); $(".select2dosubmit").live('click',function(){ var checkidedlen=$(":input[name=pro_id]:checked").length; if(checkidedlen<=0){ alert("至少选择一项"); return false; } $("#select2form").attr("action","select3.asp"); $("#select2form").trigger('submit'); }); $("#select3formbtn").click(function(e){ if($(":input[name=zhuansu]:checked").length<=0){ alert("请选择电机的转数"); return false; } $("#selectlist").html(""); $.post("select3do.asp",$("#select3form").serialize(),function(data){ $("#selectlist").html(data); }); e.preventdefault(); }); $("#select3dosubmit").live("click",function(){ $("#select3form").attr("action","?action=dosaveselect3"); if($(":input[name=pro_data_id]:checked").length<=0){ alert("对不起,请选择保存的选好,并输入数量"); return false; } $("#select3form").trigger('submit'); }); $("#select3dokeep").live("click",function(){ window.location='select2.asp'; }); $("#select3dopring").live("click",function(){ window.print(); }); $("#select3dologout").live("click",function(){ window.location='?action=dologout'; }); $("#select3doback").live('click',function(){ window.history.back(); }); var usertype=new array(); usertype[1]=array("有色冶炼、钢铁选矿泵","设计院、铜冶炼、锌冶炼、钴镍冶炼、其它有色冶炼、钢铁、稀土、稀有金属、经销商、配套企业、工程公司、其它"); usertype[2]=array("钛白粉、非金属矿用泵","设计院、钛白粉、焦化厂、高岭土、膨润土、化工、污水处理、化纤、柠檬酸、经销商、配套企业、工程公司、其它"); usertype[3]=array("环保、水处理泵","设计院、化工、脱硫除尘、污水处理、电镀废水、化纤、柠檬酸、农药、经销商、配套企业、工程公司、其它"); usertype[4]=array("电力废水、脱硫循环泵","设计院、电厂、脱硫除尘、污水处理、化纤、经销商、配套企业、其它"); usertype[5]=array("硫酸、化肥泵","设计院、磷复肥、硫酸、化纤、柠檬酸、化工、农药、经销商、配套企业、工程公司、其它"); usertype[6]=array("化工、氯碱等用泵","设计院、化工、氯碱、污水处理、化纤、柠檬酸、稀土、农药、经销商、配套企业、其它"); usertype[7]=array("泵厂","泵厂"); usertype[8]=array("其它","其它"); jquery.initusertype=function(){ $("#usertype1").append("") for(var i=1;i"+usertype[i][0]+"") } $("#usertype1").change(function(){ $("#usertype2").html(""); var curi=$(this).children(":selected").attr("id"); var arrusertype2=usertype[curi][1].split("、"); for(var i=0;i"+arrusertype2[i]+""); } }); } $(":input[name=hanguliang]").click(function(){ if($(this).val()=="含杂质"){ $("#hzz").show(); }else{ $("#hzz").hide(); } }); $(":input[name=pro_id]").live('click',function(e){ var checkidedlen=$(":input[name=pro_id]:checked").length; if(checkidedlen>2){ alert("最多只能选择两项"); return false; } }); $(":input[name=dianji]").live('click',function(e){ var checkidedlen=$(":input[name=dianji]:checked").length; if(checkidedlen>2){ alert("最多只能选择两项"); return false; } }); $(":input[name=pro_data_id]").live('click',function(){ var cn=$(this).attr("class"); var title=$(this).attr("title"); if($("."+cn+":checked").length>1){ alert("对不起,"+title+"系列内只能选一个"); return false; } }); });