﻿function killErrors() { 
 return true; 
} 
window.onerror = killErrors;

function getrediolistnum(elename){
  var rbltable = document.getElementById(elename);
  var rbs= rbltable.getElementsByTagName("INPUT");
  var selectcount=0;
  for(var i = 0;i<rbs.length;i++)
  { 
    if(rbs[i].checked)
    { 
       selectcount+=1;
    }
  }
  return selectcount;
}

function checkform(){
    if(getrediolistnum("rptQuestion_ctl00_chkAnswerCode")==0){
    alert("请回答第一个问题！");
    return false;
  }
  if(getrediolistnum("rptQuestion_ctl01_chkAnswerCode")==0){
    alert("请回答第二个问题！");
    return false;
  }
  if(getrediolistnum("rptQuestion_ctl02_chkAnswerCode")==0){
    alert("请回答第三个问题！");
    return false;
  }
  if(getrediolistnum("rptQuestion_ctl03_rdoAnswerCode")==0){
    alert("请回答第四个问题！");
    return false;
  }
  if(getrediolistnum("rptQuestion_ctl04_rdoAnswerCode")==0){
    alert("请回答第五个问题！");
    return false;
  }
  if(getrediolistnum("rptQuestion_ctl05_rdoAnswerCode")==0){
    alert("请回答第六个问题！");
    return false;
  }
  if(getrediolistnum("rptQuestion_ctl06_rdoAnswerCode")==0){
    alert("请回答第七个问题！");
    return false;
  }
  if(getrediolistnum("rptQuestion_ctl07_rdoAnswerCode")==0){
    alert("请回答第八个问题！");
    return false;
  }
  if(getrediolistnum("rptQuestion_ctl08_chkAnswerCode")==0){
    alert("请回答第九个问题！");
    return false;
  }
  if(getrediolistnum("rptQuestion_ctl09_chkAnswerCode")==0){
    alert("请回答第十个问题！");
    return false;
  }
  if(getrediolistnum("rptQuestion_ctl10_chkAnswerCode")==0){
    alert("请回答第十一个问题！");
    return false;
  }
  if(getrediolistnum("rptQuestion_ctl11_rdoAnswerCode")==0){
    alert("请回答第十二个问题！");
    return false;
  }
  if(getrediolistnum("rptQuestion_ctl12_rdoAnswerCode")==0){
    alert("请回答第十三个问题！");
    return false;
  }
  if(getrediolistnum("rptQuestion_ctl13_rdoAnswerCode")==0){
    alert("请回答第十四个问题！");
    return false;
  }
  if(getrediolistnum("rptQuestion_ctl14_chkAnswerCode")==0){
    alert("请回答第十五个问题！");
    return false;
  }
  if(document.getElementById("txtName").value==""){
		alert("请留下您的姓名！");
		document.getElementById("txtName").focus();
		return false;
	}
  if(document.getElementById("txtPhone").value==""){
		alert("请留下您的联电话！");
		document.getElementById("txtPhone").focus();
		return false;
	}
  if(document.getElementById("txtEmail").value==""){
		alert("请留下您的联系邮箱！");
		document.getElementById("txtEmail").focus();
		return false;
	}
  if(document.getElementById("txtRegion").value==""){
		alert("请留下您的所在城市！");
		document.getElementById("txtRegion").focus();
		return false;
	}
	
 if(document.getElementById("txtZip").value==""){
		alert("请留下您的邮编！");
		document.getElementById("txtZip").focus();
		return false;
	}
  if(document.getElementById("txtCPU").value==""){
		alert("请填写您的CPU配置！");
		document.getElementById("txtCPU").focus();
		return false;
	}
  if(document.getElementById("txtVideo").value==""){
		alert("请填写您的显卡配置！");
		document.getElementById("txtVideo").focus();
		return false;
	}
  if(document.getElementById("txtMemory").value==""){
		alert("请填写您的内存配置！");
		document.getElementById("txtMemory").focus();
		return false;
	}
	
var a=document.getElementById("txtContact");
a.value="";

a.value+="姓名:"+document.getElementById("txtName").value+"|";
a.value+="电话:"+document.getElementById("txtPhone").value+"|";
a.value+="邮箱:"+document.getElementById("txtEmail").value+"|";
a.value+="邮编:"+document.getElementById("txtZip").value+"|";
a.value+="CPU:"+document.getElementById("txtCPU").value+"|";
a.value+="显卡:"+document.getElementById("txtVideo").value+"|";
a.value+="内存:"+document.getElementById("txtMemory").value;

  return true;
}