<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%-- jstl1.2--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> 

<%@ page isELIgnored="false" %> 
<%@page  import="miinshop.entryDomain.dao.ShopProductCat,miinshop.entryDomain.dao.ShopProduct" %>

<%@page  import="miinshop.view.pages.OrderFormPage " %>

<%
//orderform.jsp?pid=3
OrderFormPage orderPage=new OrderFormPage(request, response, out);
orderPage.loadPageDate();

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="ShopProduct 添加实体类数据表单，path: 请情: www.juuluu.net " />

<title>订购产品</title>

    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/MyApp/Resource/RIA/jquery-easyui-1.3.2/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/MyApp/Resource/RIA/jquery-easyui-1.3.2/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/MyApp/Resource/RIA/jquery-easyui-1.3.2/demo/demo.css">
	<script type="text/javascript" src="<%=request.getContextPath()%>/MyApp/Resource/RIA/jquery-easyui-1.3.2/jquery-1.8.0.min.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/MyApp/Resource/RIA/jquery-easyui-1.3.2/jquery.easyui.min.js"></script>

 
        <%--  时间控件 --%>

<script type="text/javascript"  src="/DateTimeCalendar/DateTimeCalendar.js" language="javascript">
</script> 

</head>
<body>
<html:errors/>

<div class="title_box"><h1>订购产品</h1></div>

<script type="text/javascript" src="/juuluu.org/javascript/form.js" language="javascript"></script>
<form name="ShopOrderForm" id="ShopOrderForm"  action="./orderProduct.jsp" method="post"   >

<div id="content">
 
<input type="hidden" name="orderProductid" value="${ShopProduct.aid}" >

<p>
<span class="formElementLable">产品</span>
${ShopProduct.title}
</p>

    <p>
<span class="formElementLable">姓名</span>
<input type="text" name="orderUserName" size="30"  maxlength="45">
</p>
 
       <p>
<span class="formElementLable">送货地址</span>
<input type="text" name="sendAddress" size="30"  maxlength="45">
</p>


 <p>
<span class="formElementLable">联系电话</span>
<input type="text" name="tel" size="30"  maxlength="45">
</p>
 <p>
<span class="formElementLable">备注</span>
<input type="text" name="orderComments" size="30"  maxlength="45">
</p>
   

     <p>
<span class="formElementLable">支付方式</span>
<input type="text" name="payMethod" size="30"  maxlength="45">
</p>
    





<p>
<input id="ShopOrderFormSubmit" type="button" onClick="return formsubmit()"  value="提交"/> <input type="reset"  value="重设"/>
</p>

</div></form>


	<script type="text/javascript" language="javascript" >
	//重设表单
	function resetForm(){
		var formPage=document.forms["ShopOrderForm"];	 formPage.reset();
	 return false;
	}
	
	//提交表单，成功后提交表单
	function formsubmit(){
		var form=document.forms["ShopOrderForm"];
		if(form==null){
			alert("无法获取表单！");
			 	return false;
		}
		if(form!=null){
		//表单验证
		 var formchekcReturn=formcheck();
	 	if(formchekcReturn !=null && formchekcReturn==true){
		form.submit();
	 //将提交按钮设置为失效，防止重复提交
		var formSubmit=document.getElementById("ShopOrderFormSubmit");
	 	formSubmit.disabled= true;
	 	return true;
			 }else{
	 	return false;
		}
	 }//end if
	
	}//end fun
	//表单验证
	function formcheck(){
		var formPage=document.forms["ShopOrderForm"];		if(formPage==null){
			alert("未发现表单！");
			isreturn =false;
			return false;
			
		}
		var isreturn =true;
                
                /*
		//表单catid元素是否为空
	     var catid =formPage.catid;
		var catidValue=trim(catid.value);
			if(catidValue==null||catidValue==""){
			alert("catid不能为空！");
			catid.focus();
			isreturn =false;
			return false;
		}	//end if
		//表单viewCount元素是否为空
	     var viewCount =formPage.viewCount;
		var viewCountValue=trim(viewCount.value);
			if(viewCountValue==null||viewCountValue==""){
			alert("点击不能为空！");
			viewCount.focus();
			isreturn =false;
			return false;
		}	//end if
		*/
		//表单中文验证
		
		//表单字符长度验证
		
		//表单密码强度验证
		
		//表单是否包含字符验证
		
		//表单过长验证
		
		//判断是否提交表单
		//alert("return :"+isreturn);
		
		if(isreturn ==false){
		
		//	alert("return :"+isreturn);
		return false;
		
		}else{
		isreturn=true;
		//alert("return :"+isreturn);
		return isreturn;
		}
	}
	
	</script>

</body>
</html>

