$(document).ready(function() {
    $(".submitButton").click(function(){
		var objDom = $("#order input[type='checkbox'][name='chk[]']:checked");
		if($(objDom).length<1){
			alert("商品信息至少选择一项!");
			return false;
		}else{
			var state = 1;
			var index = '';
			$(objDom).each(function(key,val){
				if($("#num"+val.id).val()<1){
					state = 0;
					index = val.id;
					alert("商品定购数量不能为空!");
					return false;
				}
			})
			if(state>0){
				return true;
			}else{
				$("#num"+index).focus();
				return false;
			}
		}
    });
  
});


function order1()
	{
	  varParam=document.order.name.value
	  if (varParam.length==0)
	  {
		window.alert("请输入姓名！");
		document.order.name.focus();
		return false;
	  }

	
	  varParam=document.order.phone.value
	  if (varParam.length==0)
	  {
		window.alert("请输入手机号！");
		document.order.phone.focus();
		return false;
	  }
	  
	  varParam=document.order.phone.value.match(/^((13[0-9]{9})|(15[0-9]{9})|(18[0-9]{9}))$/); 
	  if(varParam==null) 
	  { 
	  alert("移动手机填写不正确!") 
	  document.order.phone.focus();
	  return false; 
	  }
	  
	  varParam=document.order.way.value
	  if (varParam=="请选择")
	  {
		window.alert("请选择付款方式！");
		document.order.way.focus();
		return false;
	  }
	  
	  varParam=document.order.address.value
	  if (varParam=="请详细填写")
	  {
		window.alert("请输入地址！");
		document.order.address.focus();
		return false;
	  }
	  
	  varParam=document.order.address.value
	  if (varParam=="")
	  {
		window.alert("请输入地址！");
		document.order.address.focus();
		return false;
	  }
	}