Author: mor
Date: Thu Jul 17 02:00:08 2008
New Revision: 677541
URL:
http://svn.apache.org/viewvc?rev=677541&view=revLog:
Fix: Could not submit form for Step 2: Shipping - One Page Checkout, when a user type a full name of country/state in autocomplete because corresponding geo Id's were not being passed to the services called on form submit and hence resulting in an error on the panel. Many thanks to Rishi Solanki for provinding this patch and also thanks to Sumit Pandit for help on this issue.
Modified:
ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/checkoutProcess.js
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=677541&r1=677540&r2=677541&view=diff==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/checkoutProcess.js (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/checkoutProcess.js Thu Jul 17 02:00:08 2008
@@ -109,8 +109,16 @@
Event.observe($('shipToCountryGeo'), 'blur', function() {
$('shipToStateProvinceGeo').value = "";
+ if ($('shipToCountryGeoId').value == "" || $('shipToCountryGeoId').value == null) {
+ setShipToCountryGeoId();
+ }
});
Event.observe($('shipToStateProvinceGeo'), 'focus', getAssociatedStateList);
+ Event.observe($('shipToStateProvinceGeo'), 'blur', function() {
+ if ($('shipToStateProvinceGeoId').value == "" || $('shipToStateProvinceGeoId').value == null) {
+ setShipToStateProvinceGeoId();
+ }
+ });
// Get associate states for billing panel
Event.observe($('billToCountryGeoId'), 'change', getAssociatedBillingStateList);
});
@@ -578,4 +586,22 @@
function setKeyAsParameter(text, li) {
$(hiddenTarget).value = li.id;
+}
+
+function setShipToCountryGeoId() {
+ countryList.each(function(country) {
+ var countryName = country.split(': ');
+ if ((($('shipToCountryGeo').value).toUpperCase()).match((countryName[0]).toUpperCase())) {
+ $('shipToCountryGeoId').value = countryName[1];
+ }
+ });
+}
+
+function setShipToStateProvinceGeoId() {
+ stateList.each(function(state) {
+ var stateName = state.split(': ');
+ if ((($('shipToStateProvinceGeo').value).toUpperCase()).match((stateName[0]).toUpperCase())) {
+ $('shipToStateProvinceGeoId').value = stateName[1];
+ }
+ });
}
\ No newline at end of file