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

1 message Options
Embed this post
Permalink
ashish-18

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

Reply Threaded More More options
Print post
Permalink
Author: ashish
Date: Tue Nov 10 15:14:14 2009
New Revision: 834493

URL: http://svn.apache.org/viewvc?rev=834493&view=rev
Log:
Applied patch from jira issue: OFBIZ-3098 - Improvement in input validation of 1st step (shopping cart) on onePageCheckout page.

On onePageCheckout page in Shopping Cart(step1), if we enter any character(not numeric value) in quantity text box, then this text box become empty and show 'required' validation message, It should show "Please enter a valid number in this field."

Step to reproduce:-
1) Add item in cart.
2) Move on onePageCheckout page.
3) Enter any character in item quantity text box.
4) Then it show validation message "required".

Thanks Amit and Rohit for the contribution.

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

Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/images/checkoutProcess.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/images/checkoutProcess.js?rev=834493&r1=834492&r2=834493&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/images/checkoutProcess.js (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/images/checkoutProcess.js Tue Nov 10 15:14:14 2009
@@ -453,13 +453,11 @@
     var elementId = qtyElement.id;
     var productIdElementId = elementId.sub('qty_', 'cartLineProductId_');
     var productId = $(productIdElementId).value;
-    if (qtyElement.value >= 0 && !isNaN(qtyElement.value)) {
+    if (qtyElement.value && qtyElement.value >= 0 && !isNaN(qtyElement.value)) {
         var itemIndex = getProductLineItemIndex(event, productId);
         qtyParam = "update_" + itemIndex +"="+qtyElement.value;
         var formValues = $('cartForm').serialize() + '&' + qtyParam;
         updateCartData(elementId, formValues, qtyElement.value, itemIndex);
-    } else {
-        qtyElement.value = "";
     }
 }
 

Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl?rev=834493&r1=834492&r2=834493&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl Tue Nov 10 15:14:14 2009
@@ -161,6 +161,7 @@
                               <input type="hidden" name="cartLineProductId" id="cartLineProductId_${cartLine_index}" value="${cartLine.getProductId()}" />
                               <input type="text" name="update${cartLine_index}" id="qty_${cartLine_index}" value="${cartLine.getQuantity()?string.number}" class="required validate-number" />
                               <span id="advice-required-qty_${cartLine_index}" style="display:none;" class="errorMessage"> (required)</span>
+                              <span id="advice-validate-number-qty_${cartLine_index}" style="display:none;" class="errorMessage"> (${uiLabelMap.CommonPleaseEnterValidNumberInThisField}) </span>
                             </#if>
                           </td>
                           <#if !cartLine.getIsPromo()>