svn commit: r674847 - in /ofbiz/trunk/applications/ecommerce/webapp/ecommerce: images/checkoutProcess.js order/OnePageCheckoutProcess.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r674847 - in /ofbiz/trunk/applications/ecommerce/webapp/ecommerce: images/checkoutProcess.js order/OnePageCheckoutProcess.ftl

mor-2
Author: mor
Date: Tue Jul  8 07:49:56 2008
New Revision: 674847

URL: http://svn.apache.org/viewvc?rev=674847&view=rev
Log:
Validation at Step 3 & Step 4 (Shipping options & Billing resp.) on One Page Checkout

Modified:
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/checkoutProcess.js
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/checkoutProcess.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/checkoutProcess.js?rev=674847&r1=674846&r2=674847&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/checkoutProcess.js (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/checkoutProcess.js Tue Jul  8 07:49:56 2008
@@ -21,8 +21,12 @@
  // Cart
     var isCartStepValidate = false;
     var isShipStepValidate = false;
+    var isShipOptionStepValidate = false;
+    var isBillStepValidate = false;
     var validateCart = new Validation('cartForm', {immediate: true, onSubmit: false});
     var validateShip = new Validation('shippingForm', {immediate: true, onSubmit: false});
+    var validateShipOption = new Validation('shippingOptionForm', {immediate: true, onSubmit: false});
+    var validateBill = new Validation('billingForm', {immediate: true, onSubmit: false});    
     Event.observe($('editShipping'), 'click', function() {
         if (validateCart.validate()) {
             displayShippingPanel();
@@ -41,36 +45,50 @@
                 processShippingAddress();
                 displayShippingOptionPanel();
                 isShipStepValidate = true;
-            }    
-        }    
+            }
+        }
     });
 
     Event.observe($('openShippingPanel'), 'click', function() {
      if (isCartStepValidate) {
-        if (isShipStepValidate) {
+            if (isShipStepValidate) {
                 displayShippingPanel();
-        }    
+            }
      }
     });
 
     // Shipping Options
     Event.observe($('editBilling'), 'click', function() {
-        setShippingOption();
-        displayBillingPanel();
+        if (isCartStepValidate && isShipStepValidate) {
+            if (validateShipOption.validate()) {
+                setShippingOption();
+                displayBillingPanel();
+                isShipOptionStepValidate = true;
+            }
+        }    
     });
 
     Event.observe($('openShippingOptionPanel'), 'click', function() {
-        displayShippingOptionPanel();
+        if (isCartStepValidate && isShipStepValidate && isShipOptionStepValidate) {
+            displayShippingOptionPanel();
+        }
     });
 
     // Billing
     Event.observe($('openBillingPanel'), 'click', function() {
-        displayBillingPanel();
+      if (isBillStepValidate) {
+            displayBillingPanel();
+        }  
     });
 
     Event.observe($('openOrderSubmitPanel'), 'click', function() {
-        processBillingAndPayment();
-        displayOrderSubmitPanel();
+        if (isCartStepValidate && isShipStepValidate && isShipOptionStepValidate) {
+            if (validateBill.validate()) {    
+                processBillingAndPayment();
+                displayOrderSubmitPanel();
+                isBillStepValidate = true;
+            }
+        }
     });
     
     //  For Billing Address Same As Shipping

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl?rev=674847&r1=674846&r2=674847&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl Tue Jul  8 07:49:56 2008
@@ -361,13 +361,13 @@
                             </div>
                             <div class="form-row">
                               <div class="field-label">
-                                <label for="state">${uiLabelMap.CommonState}<span>*</span></label>
+                                <label for="state">${uiLabelMap.CommonState}<span>*</span><span id="advice-required-shipToStateProvinceGeoId" style="display:none">(required)</span></label>
                               </div>
                               <div class="field-widget">
                                   <select name="shipToStateProvinceGeoId" id="shipToStateProvinceGeoId" class="required">
                                     <#if (parameters.shipToStateProvinceGeoId)?exists>
                                       <option>${parameters.shipToStateProvinceGeoId}</option>
-                                        <option value="${parameters.shipToStateProvinceGeoId}"</option>
+                                        <option value="${parameters.shipToStateProvinceGeoId}"></option>
                                     <#else>
                                       <option value="">${uiLabelMap.PartyNoState}</option>
                                     </#if>
@@ -505,7 +505,7 @@
                     <tr><td>
                         <div class="form-row">
                           <div class="field-label">
-                            <label for="cardFirstname">${uiLabelMap.PartyFirstName}<span class="requiredLabel"> *</span><span id="advice-required-firstNameOnCard" class="custom-advice" style="display:none">(req)</span></label>
+                            <label for="cardFirstname">${uiLabelMap.PartyFirstName}<span>*</span><span id="advice-required-firstNameOnCard" style="display: none;">(required)</span></label>
                           </div>
                           <div class="field-widget">
                             <input id="firstNameOnCard" name="firstNameOnCard" class="required" type="text" value="${parameters.firstNameOnCard?if_exists}"/>
@@ -513,7 +513,7 @@
                         </div>
                         <div class="form-row">
                           <div class="field-label">
-                            <label for="cardLastName">${uiLabelMap.PartyLastName}<span class="requiredLabel"> *</span><span id="advice-required-lastNameOnCard" class="custom-advice" style="display:none">(req)</span></label>
+                            <label for="cardLastName">${uiLabelMap.PartyLastName}<span>*</span><span id="advice-required-lastNameOnCard" style="display: none;">(required)</span></label>
                           </div>
                           <div class="field-widget">
                             <input id="lastNameOnCard" name="lastNameOnCard" class="required" type="text" value="${parameters.lastNameOnCard?if_exists}"/>
@@ -521,31 +521,31 @@
                         </div>
                         <div class="form-row">
                           <div class="field-label">
-                            <label for="cardNumber">${uiLabelMap.AccountingCardNumber} (no spaces)<span class="requiredLabel"> *</span><span id="advice-required-cardNumber" class="custom-advice" style="display:none">(req)</span><span id="advice-validate-creditcard-cardNumber" class="custom-advice" style="display:none">(req)</span></label>
+                            <label for="cardNumber">${uiLabelMap.AccountingCardNumber}<span>*</span><span id="advice-required-cardNumber" style="display: none;">(required)</span></label>
                           </div>
                           <div class="field-widget">
-                            <input id="cardNumber" autocomplete="off" name="cardNumber" class="validate-creditcard" type="text" value="${parameters.cardNumber?if_exists}" size=30 maxlength=16  />
+                            <input id="cardNumber" autocomplete="off" name="cardNumber" class="required" type="text" value="${parameters.cardNumber?if_exists}" size=30 maxlength=16  />
                           </div>
                         </div>
                         <div class="form-row">
                           <div class="field-label">
-                            <label for="CVV2">CVV2 (no spaces)<span class="requiredLabel"> *</span><span id="advice-required-cardNumber" class="custom-advice" style="display:none">(req)</span><span id="advice-validate-creditcard-cardNumber" class="custom-advice" style="display:none">(req)</span></label>
+                            <label for="CVV2">CVV2<span>*</span><span id="advice-required-CVV2" style="display:none">(required)</span></label>
                           </div>
                           <div class="field-widget">
-                            <input id="CVV2" autocomplete="off" name="cardSecurityCode" class="required validate-cvv2" size="4" type="text" maxlength="4" value=""/>
+                            <input id="CVV2" autocomplete="off" name="cardSecurityCode" class="required" size="4" type="text" maxlength="4" value=""/>
                           </div>
                         </div>
                         <div class="form-row">
                           <div class="field-label">
-                            <label for="expirationdate">${uiLabelMap.AccountingExpirationDate}<span class="requiredLabel"> *</span><span id="advice-validate-creditcard-expiration-expMonth" class="custom-advice" style="display:none">(required)</span></label>
+                            <label for="expirationdate">${uiLabelMap.AccountingExpirationDate}<span>*</span><span id="advice-validate-expMonth" class="custom-advice" style="display:none">(required)</span></label>
                           </div>
                         </div>
                         <div class="form-row">
                           <span>
-                            <label for="expMonth">Month</label>
+                            <label for="expMonth">${uiLabelMap.CommonMonth}:<span>*</span><span id="advice-required-expMonth" style="display:none">(required)</span></label>
                           </span>
                           <span>
-                            <label for="expYear">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Year</label>
+                            <label for="expYear">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${uiLabelMap.CommonYear}:<span>*</span><span id="advice-required-expYear" style="display:none">(required)</span></label>
                           </span>
                           <br>
                           <span>
@@ -574,7 +574,7 @@
                         <div id="billingAddress" <#if parameters.useShippingAddressForBilling?has_content && parameters.useShippingAddressForBilling?default("")=="Y">style="display:none"</#if>>
                           <div class="form-row">
                             <div class="field-label">
-                              <label for="address1">${uiLabelMap.PartyAddressLine1}<span class="requiredLabel"> *</span><span id="advice-required-billToAddress1" class="custom-advice" style="display:none">(required)</span></label>
+                              <label for="address1">${uiLabelMap.PartyAddressLine1}<span> *</span><span id="advice-required-billToAddress1" style="display:none">(required)</span></label>
                             </div>
                             <div class="field-widget">
                               <input id="billToAddress1" name="billToAddress1" class="required" size=30 type="text" value="${parameters.billToAddress1?if_exists}"/>
@@ -590,7 +590,7 @@
                           </div>
                           <div class="form-row">
                             <div class="field-label">                
-                              <label for="city">${uiLabelMap.CommonCity}<span class="requiredLabel"> *</span><span id="advice-required-billToCity" class="custom-advice" style="display:none">(required)</span></label>
+                              <label for="city">${uiLabelMap.CommonCity}<span>*</span><span id="advice-required-billToCity" style="display:none">(required)</span></label>
                             </div>
                             <div class="field-widget">
                               <input id="billToCity" name="billToCity" class="required" type="text" value="${parameters.billToCity?if_exists}"/>
@@ -598,7 +598,7 @@
                           </div>
                           <div class="form-row">
                             <div class="field-label">
-                               <label for="state">${uiLabelMap.CommonState}<span class="requiredLabel"> *</span></label>
+                               <label for="state">${uiLabelMap.CommonState}<span>*</span><span id="advice-required-billToStateProvinceGeoId" style="display:none">(required)</span></label>
                             </div>
                             <div class="field-widget">
                               <select id="billToStateProvinceGeoId" name="billToStateProvinceGeoId" class="required">
@@ -614,15 +614,15 @@
                           </div>
                           <div class="form-row">
                             <div class="field-label">
-                              <label for="billToPostalCode">${uiLabelMap.PartyZipCode}<span class="requiredLabel"> *</span><span id="advice-required-billToPostalCode" class="custom-advice" style="display:none">(required)</span><span id="advice-validate-billToPostalCode" class="custom-advice" style="display:none">(required)</span></label>  
+                              <label for="billToPostalCode">${uiLabelMap.PartyZipCode}<span>*</span><span id="advice-required-billToPostalCode" style="display:none">(required)</span></label>  
                             </div>
                             <div class="field-widget">
-                              <input id="billToPostalCode" name="billToPostalCode" class="required validate-zip input_mask mask_zip" type="text" value="${parameters.billToPostalCode?if_exists}"/>
+                              <input id="billToPostalCode" name="billToPostalCode" class="required" type="text" value="${parameters.billToPostalCode?if_exists}"/>
                             </div>
                           </div>
                           <div class="form-row">
                             <div class="field-label">
-                              <label for="billToCountryGeoId">${uiLabelMap.PartyCountry}<span class="requiredLabel"> *</span></label>
+                              <label for="billToCountryGeoId">${uiLabelMap.PartyCountry}<span>*</span><span id="advice-required-billToCountryGeoId" style="display:none">(required)</span></label>
                             </div>
                             <div class="field-widget">
                               <select name="billToCountryGeoId" id="billToCountryGeoId" class="required">