|
Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/customer/profile/NewCustomer.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/customer/profile/NewCustomer.ftl?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/customer/profile/NewCustomer.ftl (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/customer/profile/NewCustomer.ftl Fri Dec 10 20:40:08 2010 @@ -107,9 +107,9 @@ under the License. <span id="advice-required-shipToAreaCode" style="display:none" class="errorMessage"></span> <span id="advice-required-shipToContactNumber" style="display:none" class="errorMessage"></span> <span id="shipToPhoneRequired" style="display: none;" class="errorMessage">(${uiLabelMap.CommonRequired})</span> - <input type="text" name="shipToCountryCode" id="shipToCountryCode" class="required" value="${parameters.shipToCountryCode?if_exists}" size="3" maxlength="3" /> - - <input type="text" name="shipToAreaCode" id="shipToAreaCode" class="required" value="${parameters.shipToAreaCode?if_exists}" size="3" maxlength="3" /> - - <input type="text" name="shipToContactNumber" id="shipToContactNumber" class="required" value="${contactNumber?default("${parameters.shipToContactNumber?if_exists}")}" size="6" maxlength="7" /> + <input type="text" name="shipToCountryCode" id="shipToCountryCode" value="${parameters.shipToCountryCode?if_exists}" size="3" maxlength="3" /> + - <input type="text" name="shipToAreaCode" id="shipToAreaCode" value="${parameters.shipToAreaCode?if_exists}" size="3" maxlength="3" /> + - <input type="text" name="shipToContactNumber" id="shipToContactNumber" value="${contactNumber?default("${parameters.shipToContactNumber?if_exists}")}" size="6" maxlength="7" /> - <input type="text" name="shipToExtension" id="shipToExtension" value="${extension?default("${parameters.shipToExtension?if_exists}")}" size="3" maxlength="3" /> </div> <div class="inline"> @@ -162,9 +162,9 @@ under the License. <span id="advice-required-billToAreaCode" style="display:none" class="errorMessage"></span> <span id="advice-required-billToContactNumber" style="display:none" class="errorMessage"></span> <span id="billToPhoneRequired" style="display: none;" class="errorMessage">(${uiLabelMap.CommonRequired})</span> - <input type="text" name="billToCountryCode" id="billToCountryCode" class="required" value="${parameters.billToCountryCode?if_exists}" size="3" maxlength="3"/> - - <input type="text" name="billToAreaCode" id="billToAreaCode" class="required" value="${parameters.billToAreaCode?if_exists}" size="3" maxlength="3"/> - - <input type="text" name="billToContactNumber" id="billToContactNumber" class="required" value="${contactNumber?default("${parameters.billToContactNumber?if_exists}")}" size="6" maxlength="7"/> + <input type="text" name="billToCountryCode" id="billToCountryCode" value="${parameters.billToCountryCode?if_exists}" size="3" maxlength="3"/> + - <input type="text" name="billToAreaCode" id="billToAreaCode" value="${parameters.billToAreaCode?if_exists}" size="3" maxlength="3"/> + - <input type="text" name="billToContactNumber" id="billToContactNumber" value="${contactNumber?default("${parameters.billToContactNumber?if_exists}")}" size="6" maxlength="7"/> - <input type="text" name="billToExtension" id="billToExtension" value="${extension?default("${parameters.billToExtension?if_exists}")}" size="3" maxlength="3"/> </div> </fieldset> 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=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/images/checkoutProcess.js (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/images/checkoutProcess.js Fri Dec 10 20:40:08 2010 @@ -21,108 +21,117 @@ var isShipStepValidate = false; var isShipOptionStepValidate = false; var isBillStepValidate = false; -document.observe('dom:loaded', function() { +jQuery(document).ready(function(){ // Cart - 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}); - + var validateCart = jQuery("#cartForm"); + validateCart.validate(); + + var validateShip = jQuery("#shippingForm"); + validateShip.validate(); + + var validateShipOption = jQuery("#shippingOptionForm"); + validateShipOption.validate(); + + var validateBill = jQuery("#billingForm"); + validateBill.validate(); + // Goto Edit Cart Panel - Event.observe($('openCartPanel'), 'click', function() { + jQuery('#openCartPanel').click(function() { showEditCartPanel(); updateShippingSummary(); }); // Update Shipping Address - Event.observe($('savePartyAndShippingContact'), 'click', function() { - if (validateShip.validate()) { - Effect.Fade('savePartyAndShippingContact', {duration: 0.0}); - Effect.Appear('processingShippingOptions', {duration: 0.0}); + jQuery('#savePartyAndShippingContact').click(function() { + if (validateShip.valid()) { + jQuery('#savePartyAndShippingContact').fadeOut('fast'); + jQuery('#processingShippingOptions').fadeIn('fast'); if (createUpdateCustomerAndShippingAddress()){ showEditShippingOptionPanel(); } - Effect.Fade('processingShippingOptions', {duration: 0.0}); - Effect.Appear('savePartyAndShippingContact', {duration: 0.0}); + jQuery('#processingShippingOptions').fadeOut('fast'); + jQuery('#savePartyAndShippingContact').fadeIn('fast'); } }); // Goto Edit Shipping panel - Event.observe($('updateShoppingCart'), 'click', function() { - if (validateCart.validate()) { + jQuery('#updateShoppingCart').click(function() { + if (validateCart.valid()) { showEditShippingPanel(); } }); // Goto Edit Shipping Panel - Event.observe($('openShippingPanel'), 'click', function() { + jQuery('#openShippingPanel').click(function() { showEditShippingPanel(); setShippingOption(); }); // Set Shipping Method to card and goto Billing step - Event.observe($('saveShippingMethod'), 'click', function() { - Effect.Fade('saveShippingMethod', {duration: 0.0}); - Effect.Appear('processingBilling', {duration: 0.0}); + jQuery('#saveShippingMethod').click(function() { + jQuery('#saveShippingMethod').fadeOut('fast'); + jQuery('#processingBilling').fadeIn('fast'); if (setShippingOption()){ showEditBillingPanel(); } - Effect.Fade('processingBilling', {duration: 0.0}); - Effect.Appear('saveShippingMethod', {duration: 0.0}); + jQuery('#processingBilling').fadeOut('fast'); + jQuery('#saveShippingMethod').fadeIn('fast'); }); - Event.observe($('openShippingOptionPanel'), 'click', function() { + jQuery('#openShippingOptionPanel').click(function() { showEditShippingOptionPanel(); updateBillingSummary(); }); // Billing - Event.observe($('openBillingPanel'), 'click', function() { + jQuery('#openBillingPanel').click(function() { showEditBillingPanel(); }); - Event.observe($('savePaymentAndBillingContact'), 'click', function() { - if (validateBill.validate()) { - Effect.Fade('savePaymentAndBillingContact', {duration: 0.0}); - Effect.Appear('processingOrderSubmitPanel', {duration: 0.0}); + jQuery('#savePaymentAndBillingContact').click(function() { + if (validateBill.valid()) { + jQuery('#savePaymentAndBillingContact').fadeOut('fast'); + jQuery('#processingOrderSubmitPanel').fadeIn('fast'); if (processBillingAndPayment()) { showOrderSubmitPanel(); } - Effect.Fade('processingOrderSubmitPanel', {duration: 0.0}); - Effect.Appear('savePaymentAndBillingContact', {duration: 0.0}); + jQuery('#processingOrderSubmitPanel').fadeOut('fast'); + jQuery('#savePaymentAndBillingContact').fadeIn('fast'); } }); // For Billing Address Same As Shipping - Event.observe('useShippingAddressForBilling', 'click', function() { + jQuery('#useShippingAddressForBilling').click(function() { useShippingAddressForBillingToggle(); - validateBill.validate(); + validateBill.valid(); }); // Initiate Observing Edit Cart Events initCartProcessObservers(); - Event.observe('processOrderButton', 'click', processOrder); + jQuery('#processOrderButton').click(function(){ + processOrder(); + }); - if ($('shippingForm')) { + if (jQuery('#shippingForm').length) { // Get associate states for Shipping Information - Event.observe($('shipToCountryGeoId'), 'change', function(){ + jQuery('#shipToCountryGeoId').change(function(){ getAssociatedStateList('shipToCountryGeoId', 'shipToStateProvinceGeoId', 'advice-required-shipToStateProvinceGeoId', 'shipToStates'); }); - if ($('userLoginId')) { - var stateValue = $('shipToStateProvinceGeoId').value; + if (jQuery('#userLoginId').length) { + var stateValue = jQuery('#shipToStateProvinceGeoId').val(); getAssociatedStateList('shipToCountryGeoId', 'shipToStateProvinceGeoId', 'advice-required-shipToStateProvinceGeoId', 'shipToStates'); - $('shipToStateProvinceGeoId').value = stateValue; - stateValue = $('billToStateProvinceGeoId').value; + jQuery('#shipToStateProvinceGeoId').val(stateValue); + stateValue = jQuery('#billToStateProvinceGeoId').val(); getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId', 'advice-required-billToStateProvinceGeoId', 'billToStates'); - $('billToStateProvinceGeoId').value = stateValue; + jQuery('#billToStateProvinceGeoId').val(stateValue); } else { getAssociatedStateList('shipToCountryGeoId', 'shipToStateProvinceGeoId', 'advice-required-shipToStateProvinceGeoId', 'shipToStates'); getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId', 'advice-required-billToStateProvinceGeoId', 'billToStates'); } } - if ($('billingForm')) { + if (jQuery('#billingForm').length) { // Get associate states for Billing Information - Event.observe($('billToCountryGeoId'), 'change', function() { + jQuery('#billToCountryGeoId').change(function() { getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId', 'advice-required-billToStateProvinceGeoId', 'billToStates'); }); } @@ -147,158 +156,163 @@ function getServerError(data) { // Begin Show/Hide Step panels function hideEditCartPanel() { - if ($('editCartPanel').visible() ) { - Effect.BlindUp('editCartPanel',{duration: 0.0}); - Effect.BlindDown('cartSummaryPanel',{duration: 0.0}); + if (jQuery('#editCartPanel').is(':visible')) { + jQuery('#editCartPanel').slideUp(); + jQuery('#cartSummaryPanel').slideDown(); } } function hideEditShippingPanel() { - if ($('editShippingPanel').visible()) { - Effect.BlindUp('editShippingPanel', {duration: 0.0}); - Effect.BlindDown('shippingSummaryPanel', {duration: 0.0}); + if (jQuery('#editShippingPanel').is(':visible')) { + jQuery('#editShippingPanel').slideUp(); + jQuery('#shippingSummaryPanel').slideDown(); } } function hideEditShippingOptionPanel() { - if ($('editShippingOptionPanel').visible()) { - Effect.BlindUp('editShippingOptionPanel', {duration: 0.0}); - Effect.BlindDown('shippingOptionSummaryPanel', {duration: 0.0}); + if (jQuery('#editShippingOptionPanel').is(':visible')) { + jQuery('#editShippingOptionPanel').slideUp(); + jQuery('#shippingOptionSummaryPanel').slideDown(); } } function hideEditBillingPanel() { - if ($('editBillingPanel').visible()) { - Effect.BlindUp('editBillingPanel', {duration: 0.0}); - Effect.BlindDown('billingSummaryPanel', {duration: 0.0}); + if (jQuery('#editBillingPanel').is(':visible')) { + jQuery('#editBillingPanel').slideUp(); + jQuery('#billingSummaryPanel').slideDown(); } } function hideOrderSubmitPanel() { - if ($('orderSubmitPanel').visible()) { - Effect.BlindUp('orderSubmitPanel', {duration: 0.0}); - Effect.Fade('processingOrderButton', {duration: 0.0}); + if (jQuery('#orderSubmitPanel').is(':visible')) { + jQuery('#orderSubmitPanel').slideUp(); + jQuery('#processingOrderButton').slideDown(); } } function showEditCartPanel() { - if (!$('editCartPanel').visible() ) { - Effect.BlindUp('cartSummaryPanel',{duration: 0.0}); + if (!jQuery('#editCartPanel').is(':visible') ) { + jQuery('#cartSummaryPanel').slideUp(); hideEditShippingPanel(); hideEditShippingOptionPanel(); hideEditBillingPanel(); hideOrderSubmitPanel(); - Effect.BlindDown('editCartPanel',{duration: 0.0}); + jQuery('#editCartPanel').slideDown(); } } function showEditShippingPanel() { - if (!$('editShippingPanel').visible()) { - Effect.BlindUp('shippingSummaryPanel', {duration: 0.0}); + if (!jQuery('#editShippingPanel').is(':visible') ) { + jQuery('#shippingSummaryPanel').slideUp(); hideEditCartPanel(); hideEditShippingOptionPanel(); hideEditBillingPanel(); hideOrderSubmitPanel(); - Effect.BlindDown('editShippingPanel'); + jQuery('#editShippingPanel').slideDown(); } } function showEditShippingOptionPanel() { - if (!$('editShippingOptionPanel').visible()) { - Effect.BlindUp('shippingOptionSummaryPanel', {duration: 0.0}); + if (!jQuery('#editShippingOptionPanel').is(':visible') ) { + jQuery('#shippingOptionSummaryPanel').slideUp(); hideEditCartPanel(); hideEditShippingPanel(); hideEditBillingPanel(); hideOrderSubmitPanel(); - Effect.BlindDown('editShippingOptionPanel', {duration: 0.0}); + jQuery('#editShippingOptionPanel').slideDown(); } } function showEditBillingPanel() { - - if (!$('editBillingPanel').visible()) { - Effect.BlindUp('billingSummaryPanel', {duration: 0.0}); + if (!jQuery('#editBillingPanel').is(':visible') ) { + jQuery('#billingSummaryPanel').slideUp(); hideEditCartPanel(); hideEditShippingPanel(); hideEditShippingOptionPanel(); hideOrderSubmitPanel(); - Effect.BlindDown('editBillingPanel', {duration: 0.0}); + jQuery('#editBillingPanel').slideDown(); } - if ($F('shipToContactMechId') != $F('billToContactMechId')) { - $('useShippingAddressForBilling').checked = false; - Effect.BlindDown($('billingAddress'), {duration: 0.3}); - $('useShippingAddressForBilling').value = "N"; + if (jQuery('#shipToContactMechId').val() != jQuery('#billToContactMechId').val()) { + jQuery('#useShippingAddressForBilling').val('false'); + jQuery('#billingAddress').slideDown(); + jQuery('#useShippingAddressForBilling').val('N'); } } function showOrderSubmitPanel() { - if (!$('orderSubmitPanel').visible()) { + if (!jQuery('#orderSubmitPanel').is(':visible')) { hideEditCartPanel(); hideEditShippingPanel(); hideEditShippingOptionPanel(); hideEditBillingPanel(); - Effect.BlindDown('orderSubmitPanel', {duration: 0.0}); + jQuery('#orderSubmitPanel').slideDown(); } } // End Show/Hide Step panels - function createUpdateCustomerAndShippingAddress() { var result = false; - - new Ajax.Request('createUpdateShippingAddress', { - asynchronous: false, - onSuccess: function(transport) { - var data = transport.responseText.evalJSON(true); - var serverError = getServerError(data); - if (serverError != "") { - $('shippingFormServerError').update(serverError); - } else { - Effect.Fade('shippingFormServerError'); - // Process Shipping data response. - $('shipToPartyId').value = data.partyId; - $('billToPartyId').value = data.partyId; - $('shipToContactMechId').value = data.contactMechId; - $('shipToPhoneContactMechId').value = data.phoneContactMechId; - $('emailContactMechId').value = data.emailContactMechId; - //$('completedShippingMethod').update(data.shippingDescription); - updateShippingSummary(); - getShipOptions(); - result = true; + jQuery.ajax({ + url: 'createUpdateShippingAddress', + type: 'POST', + dataType: 'json', + async: false, + data: jQuery('#shippingForm').serialize(), + success: function(json) { + jQuery('#shippingFormServerError').fadeOut('fast'); + // Process Shipping data response. + jQuery('#shipToPartyId').val(json.partyId); + jQuery('#billToPartyId').val(json.partyId); + jQuery('#shipToContactMechId').val(json.contactMechId); + jQuery('#shipToPhoneContactMechId').val(json.phoneContactMechId); + jQuery('#emailContactMechId').val(json.emailContactMechId); + //jQuery('#completedShippingMethod').html(json.shippingDescription); + updateShippingSummary(); + getShipOptions(); + result = true; + }, + error: function(error) { + if (error != "") { + jQuery('#shippingFormServerError').html(serverError); } - }, parameters: $('shippingForm').serialize(), requestHeaders: {Accept: 'application/json'} + result = false; + }, }); return result; } function getShipOptions() { - var result = false; var shipOptions = null; var optionList = []; - if ($F('shipMethod') == "" || $F('shipMethod') == null) { - new Ajax.Request('getShipOptions', { - asynchronous: false, - onSuccess: function(transport) { - var data = transport.responseText.evalJSON(true); - var serverError = getServerError(data); - if (serverError != "") { - Effect.Appear('shippingFormServerError'); - $('shippingFormServerError').update(serverError); + var result = false; + if (jQuery('#shipMethod').val() == "" || jQuery('#shipMethod').val() == null) { + jQuery.ajax({ + url: 'getShipOptions', + type: 'POST', + dataType: 'json', + async: false, + success: function(json) { + jQuery('#shippingFormServerError').fadeOut('fast'); + isShipStepValidate = true; + shipOptions = json.shippingOptions; + var shipMethod = jQuery('#shipMethod'); + shipMethod.find("option").remove(); + jQuery.each(shipOptions, function(shipOption) { + if (this.productStoreShipMethId){ + shipMethod.append(jQuery("<option value = " + this.shippingMethod + ":" + this.productStoreShipMethId + " > " + this.shippingDesc + " </option>")); + } else { + shipMethod.append(jQuery("<option value = " + this.shippingMethod + " > " + this.shippingDesc + " </option>")); + } + }); + result = true; + }, + error: function(error) { + if (error != "") { + jQuery('#shippingFormServerError').fadeIn('fast'); + jQuery('#shippingFormServerError').html(error); isShipStepValidate = false; - } else { - Effect.Fade('shippingFormServerError'); - isShipStepValidate = true; - shipOptions = data.shippingOptions; - shipOptions.each( function(shipOption) { - if (shipOption.productStoreShipMethId){ - optionList.push("<option value = " + shipOption.shippingMethod + ":" + shipOption.productStoreShipMethId + " > " + shipOption.shippingDesc + " </option>"); - } else { - optionList.push("<option value = " + shipOption.shippingMethod + " > " + shipOption.shippingDesc + " </option>"); - } - }); - $('shipMethod').update(optionList); - result = true; } - }, requestHeaders: {Accept: 'application/json'} + result = false; + }, }); } return result; @@ -306,306 +320,278 @@ function getShipOptions() { // Shipping option function setShippingOption() { - var result = false; var shipTotal = null; var shipMethod = null; - Effect.Fade('shippingOptionFormServerError'); - new Ajax.Request('setShippingOption', { - asynchronous: false, - onSuccess: function(transport) { - var data = transport.responseText.evalJSON(true); - shipTotal = data.shippingTotal; - var serverError = getServerError(data); - if(serverError != "") { - Effect.Appear('shippingOptionFormServerError'); - $('shippingOptionFormServerError').update(serverError); - isShipOptionStepValidate = false; - } else { + var result = false; + jQuery('#shippingOptionFormServerError').fadeOut('fast'); + jQuery.ajax({ + url: 'setShippingOption', + type: 'POST', + dataType: 'json', + async: false, + data: jQuery('#shippingOptionForm').serialize(), + success: function(json) { + shipTotal = json.shippingTotal; isShipOptionStepValidate = true; - $('selectedShipmentOption').update(data.shippingDescription); - //$('shippingDescription').value = data.shippingDescription; - //$('shippingTotal').value = data.shippingTotal; - //$('cartGrandTotal').value = data.cartGrandTotal; - //$('totalSalesTax').value = data.totalSalesTax; + jQuery('#selectedShipmentOption').html(json.shippingDescription); + //jQuery('#shippingDescription').value = json.shippingDescription; + //jQuery('#shippingTotal').val(json.shippingTotal); + //jQuery('#cartGrandTotal').val(json.cartGrandTotal); + //jQuery('#totalSalesTax').val(json.totalSalesTax); result = true; + }, + error: function(error) { + if(error != "") { + jQuery('#shippingOptionFormServerError').fadeIn('fast'); + jQuery('#shippingOptionFormServerError').html(error); + isShipOptionStepValidate = false; } - }, parameters: $('shippingOptionForm').serialize(), requestHeaders: {Accept: 'application/json'} + result = false; + }, }); updateCartData(); return result; } - // Billing function useShippingAddressForBillingToggle() { - if ($('useShippingAddressForBilling').checked) { - $('billToAddress1').value = $F('shipToAddress1'); - $('billToAddress2').value = $F('shipToAddress2'); - $('billToCity').value = $F('shipToCity'); - $('billToPostalCode').value = $F('shipToPostalCode'); - $('billToCountryGeoId').value = $F('shipToCountryGeoId'); + if (jQuery('#useShippingAddressForBilling').is(':checked') ) { + jQuery('#billToAddress1').val(jQuery('#shipToAddress1').val()); + jQuery('#billToAddress2').val(jQuery('#shipToAddress2').val()); + jQuery('#billToCity').val(jQuery('#shipToCity').val()); + jQuery('#billToPostalCode').val(jQuery('#shipToPostalCode').val()); + jQuery('#billToCountryGeoId').val(jQuery('#shipToCountryGeoId').val()); getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId','advice-required-billToStateProvinceGeoId','billToStates'); - $('useShippingAddressForBilling').value = "Y"; - $('billToStateProvinceGeoId').value = $F('shipToStateProvinceGeoId'); - Effect.BlindUp($('billingAddress'), {duration: 0.3}); + jQuery('#useShippingAddressForBilling').val("Y"); + jQuery('#billToStateProvinceGeoId').val(jQuery('#shipToStateProvinceGeoId').val()); + jQuery('#billingAddress').slideUp(); } else { - Effect.BlindDown($('billingAddress'), {duration: 0.3}); - $('useShippingAddressForBilling').value = "N"; + jQuery('#billingAddress').slideDown(); + jQuery('#useShippingAddressForBilling').val("N"); } } - function processBillingAndPayment() { var result = false; - new Ajax.Request('createUpdateBillingAndPayment', { - asynchronous: false, - onSuccess: function(transport) { - var data = transport.responseText.evalJSON(true); - var serverError = getServerError(data); - if(serverError != "") { - Effect.Appear('billingFormServerError'); - $('billingFormServerError').update(serverError); + jQuery.ajax({ + url: 'createUpdateBillingAndPayment', + type: 'POST', + dataType: 'json', + data: jQuery('#billingForm').serialize(), + async: false, + success: function(json) { + jQuery('#billingFormServerError').fadeOut('fast'); + isBillStepValidate = true; + jQuery('#billToContactMechId').val(json.contactMechId); + jQuery('#paymentMethodId').val(json.paymentMethodId); + jQuery('#billToPhoneContactMechId').val(json.phoneContactMechId); + updateBillingSummary(); + result = true; + }, + error: function(error) { + if(error != "") { + jQuery('#billingFormServerError').fadeIn('fast'); + jQuery('#billingFormServerError').html(error); isBillStepValidate = false; - } else { - Effect.Fade('billingFormServerError'); - isBillStepValidate = true; - $('billToContactMechId').value = data.contactMechId; - $('paymentMethodId').value = data.paymentMethodId; - $('billToPhoneContactMechId').value = data.phoneContactMechId; - updateBillingSummary(); - result = true; } - }, parameters: $('billingForm').serialize(), requestHeaders: {Accept: 'application/json'} + result = false; + }, }); return result; } - function initCartProcessObservers() { - var cartForm = $('cartForm'); - Event.observe($('productPromoCode'), 'change', addPromoCode); - Event.observe($('updateShoppingCart'), 'click', showEditShippingPanel); - Event.observe($('openCartPanel'), 'click', function() { + var cartForm = jQuery('#cartForm'); + jQuery('#productPromoCode').change(function() { + addPromoCode(); + }); + jQuery('#updateShoppingCart').click(function() { + showEditShippingPanel(); + }); + jQuery('#openCartPanel').click(function() { showEditCartPanel(); updateShippingSummary(); }); - var inputs = cartForm.getInputs('text'); + var inputs = cartForm.find(':text'); inputs.each(function(e) { if(e.id != 'productPromoCode') { - Event.observe(e, 'change', cartItemQtyChanged); + jQuery(e).change(function() { + cartItemQtyChanged(); + }); } }); - var links = $$('form#cartForm a'); - links.each( function(e) { - if ((e.id).startsWith('removeItemLink_')) { - Event.observe(e, 'click', removeItem); - } + var links = jQuery("#cartForm a[id^='removeItemLink_']"); + jQuery.each(links, function() { + jQuery(this).bind('click', function(){ + removeItem(this); + }); }); - if ($('initializedCompletedCartDiscount') != undefined && $('initializedCompletedCartDiscount').value == 0) { - $('completedCartDiscountRow').hide(); + if (jQuery('#initializedCompletedCartDiscount').length && jQuery('#initializedCompletedCartDiscount').val() == 0) { + jQuery('#completedCartDiscountRow').hide(); } } - function addPromoCode() { - new Ajax.Request('silentAddPromoCode', { - asynchronous: false, - onSuccess: function(transport) { - var data = transport.responseText.evalJSON(true); - var serverError = getServerError(data); - if(serverError != "") { - Effect.Appear('cartFormServerError'); - $('cartFormServerError').update(serverError); - } else { - Effect.Fade('cartFormServerError'); - updateCartData(); + jQuery.ajax({ + url: 'silentAddPromoCode', + type: 'POST', + dataType: 'json', + data: {"productPromoCodeId" : jQuery('#productPromoCode').val()}, + success: function(json) { + jQuery('#cartFormServerError').fadeOut('fast'); + updateCartData(); + }, + error: function(error) { + if(error != "") { + jQuery('#cartFormServerError').fadeIn('fast'); + jQuery('#cartFormServerError').html(error); } }, - parameters: {productPromoCodeId:$F('productPromoCode')} }); } function getProductLineItemIndex(event, productId) { var itemIndex = null; var productIdParam = "productId=" + productId; - var formValues = $('cartForm').serialize() + "&" + productIdParam; - new Ajax.Request('getShoppingCartItemIndex', { - asynchronous: false, - onSuccess: function(transport) { - var data = transport.responseText.evalJSON(true); - itemIndex = data.itemIndex; - }, - parameters: formValues + var formValues = jQuery('#cartForm').serialize() + "&" + productIdParam; + jQuery.ajax({ + url: 'getShoppingCartItemIndex', + type: 'POST', + dataType: 'json', + async: false, + data: formValues, + success: function(json) { + itemIndex = json.itemIndex; + } }); return itemIndex; } -function removeItem(event) { - var removeElement = Event.element(event); +function removeItem(elmt) { + var removeElement = elmt; var elementId = removeElement.id; var qtyId = elementId.sub('remove_', 'qty_'); var productIdElementId = elementId.sub('remove_', 'cartLineProductId_'); - var productId = $(productIdElementId).value; - var itemIndex = getProductLineItemIndex(event,productId); + var productId = jQuery(productIdElementId).val(); + var itemIndex = getProductLineItemIndex(elmt, productId); var formValues = "update_" + itemIndex + "= 0"; - if ($(qtyId).value == '' || isNaN(qtyId.value)) { - $(qtyId).value = 0; + if (jQuery(qtyId).val() == '' || isNaN(jQuery(qtyId).val())) { + jQuery(qtyId).val("0"); } updateCartData(qtyId, formValues, 0, itemIndex); } -function cartItemQtyChanged(event) { - var qtyElement = Event.element(event); +function cartItemQtyChanged(elmt) { + var qtyElement = elmt; var elementId = qtyElement.id; var productIdElementId = elementId.sub('qty_', 'cartLineProductId_'); - var productId = $(productIdElementId).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; + var productId = jQuery(productIdElementId).val(); + if (jQuery(qtyElement).val() && jQuery(qtyElement).val() >= 0 && !isNaN(jQuery(qtyElement).val())) { + var itemIndex = getProductLineItemIndex(elmt, productId); + qtyParam = "update_" + itemIndex +"="+jQuery(qtyElement).val(); + var formValues = jQuery('#cartForm').serialize() + '&' + qtyParam; updateCartData(elementId, formValues, qtyElement.value, itemIndex); } } function updateCartData(elementId, formValues, itemQty, itemIndex) { - new Ajax.Request('cartItemQtyUpdate', { - asynchronous: true, - onSuccess: function(transport) { - var data = transport.responseText.evalJSON(true); - if (data.totalQuantity == 0) { - $('emptyCartCheckoutPanel').show(); - $('checkoutPanel').hide(); - $('microCartNotEmpty').hide(); - $('microCartEmpty').show(); - $('quickCheckoutEnabled').hide(); - $('quickCheckoutDisabled').show(); - $('onePageCheckoutEnabled').hide(); - $('onePageCheckoutDisabled').show(); - $('googleCheckoutEnabled').hide(); - $('googleCheckoutDisabled').show(); - $('microCartPayPalCheckout').hide(); + jQuery.ajax({ + url: 'cartItemQtyUpdate', + type: 'POST', + dataType: 'json', + data: formValues, + success: function(json) { + if (json.totalQuantity == 0) { + jQuery('#emptyCartCheckoutPanel').show(); + jQuery('#checkoutPanel').hide(); + jQuery('#microCartNotEmpty').hide(); + jQuery('#microCartEmpty').show(); + jQuery('#quickCheckoutEnabled').hide(); + jQuery('#quickCheckoutDisabled').show(); + jQuery('#onePageCheckoutEnabled').hide(); + jQuery('#onePageCheckoutDisabled').show(); + jQuery('#googleCheckoutEnabled').hide(); + jQuery('#googleCheckoutDisabled').show(); + jQuery('#microCartPayPalCheckout').hide(); } else { // Replace whole cart panel with updated cart values for updating line item in case of gift item is added or remove in cart after applying coupon code - // No need to calculate indivisual value for shopping cart when whole cart is updating - new Ajax.Updater($('cartPanel'), 'UpdateCart', {evalScripts: true, method: '', onComplete:function() - { - initCartProcessObservers(); - } + // No need to calculate individual value for shopping cart when whole cart is updating + jQuery('#cartPanel').load('UpdateCart', function() { + initCartProcessObservers(); }); - /*$('microCartQuantity').update(data.totalQuantity); - $('cartSubTotal').update(data.subTotalCurrencyFormatted); - $('cartDiscountValue').update(data.displayOrderAdjustmentsTotalCurrencyFormatted); - $('cartTotalShipping').update(data.totalShippingCurrencyFormatted); - $('cartTotalSalesTax').update(data.totalSalesTaxCurrencyFormatted); - $('microCartTotal').update(data.displayGrandTotalCurrencyFormatted); - $('cartDisplayGrandTotal').update(data.displayGrandTotalCurrencyFormatted); - // Used for summary - $('completedCartSubTotal').update(data.subTotalCurrencyFormatted); - $('completedCartTotalShipping').update(data.totalShippingCurrencyFormatted); - $('completedCartTotalSalesTax').update(data.totalSalesTaxCurrencyFormatted); - $('completedCartDisplayGrandTotal').update(data.displayGrandTotalCurrencyFormatted); - $('completedCartDiscount').update(data.displayOrderAdjustmentsTotalCurrencyFormatted); - if (elementId != undefined && $(elementId).value != "") { - if (itemQty == 0) { - var cartItemRowId = elementId.sub('qty_','cartItemRow_'); - $(cartItemRowId).remove(); - var cartItemDisplayRowId = elementId.sub('qty_','cartItemDisplayRow_'); - $(cartItemDisplayRowId).remove(); - } else { - var itemsHash = $H(data.cartItemData); - $(elementId).value = itemsHash.get("displayItemQty_"+itemIndex); - var lineItemPrice = itemsHash.get("displayItemPrice_"+itemIndex); - var cartItemPrice = elementId.sub('qty_','itemUnitPrice_'); - var completedCartItemPrice = elementId.sub('qty_','completedCartItemPrice_'); - $(cartItemPrice).update(lineItemPrice); - $(completedCartItemPrice).update(lineItemPrice); - var lineTotalId = elementId.sub('qty_','displayItem_'); - var lineDiscountTotalId = elementId.sub('qty_','addPromoCode_'); - var lineItemTotal = itemsHash.get("displayItemSubTotalCurrencyFormatted_"+itemIndex); - var lineItemAdjustment = itemsHash.get("displayItemAdjustment_"+itemIndex); - $(lineTotalId).update(lineItemTotal); - $(lineDiscountTotalId).update(lineItemAdjustment); - var completedLineItemQtyId = elementId.sub('qty_','completedCartItemQty_'); - $(completedLineItemQtyId).update($(elementId).value); - $('completedCartItemAdjustment_'+itemIndex).update(lineItemAdjustment); - var completedCartItemSubTotalId = elementId.sub('qty_','completedCartItemSubTotal_'); - $(completedCartItemSubTotalId).update(lineItemTotal); - } - }*/ + } }, - parameters: formValues }); } - function processOrder() { - $('processOrderButton').disabled = true ; - Effect.Fade('processOrderButton', {duration: 0.1}); - Effect.Appear('processingOrderButton', {duration: 0.1}); - $('orderSubmitForm').submit(); + jQuery('#processOrderButton').disabled = true ; + jQuery('#processOrderButton').fadeOut('fast'); + jQuery('#processingOrderButton').fadeIn('fast'); + jQuery('#orderSubmitForm').submit(); } - function getAssociatedBillingStateList(formName, divId) { var optionList = []; - new Ajax.Request("getAssociatedStateList", { - asynchronous: false, - parameters: $(formName).serialize(), - onSuccess: function(transport) { - var data = transport.responseText.evalJSON(true); + jQuery.ajax({ + url: "getAssociatedStateList", + data: jQuery(formName).serialize(), + async: false, + success: function(transport) { stateList = data.stateList; - stateList.each(function(state) { - geoVolues = state.split(': '); - optionList.push("<option value = "+geoVolues[1]+" >"+geoVolues[0]+"</option>"); + var billingStates = jQuery("#" + divId); + billingStates.find("option").remove(); + jQuery.each(stateList, function(state) { + geoVolues = this.split(': '); + billingStates.append(jQuery("<option value = " + geoVolues[1] + " >" + geoVolues[0] + "</option>")); }); - $(divId).update(optionList); } }); } function updateShippingSummary() { - var fullName = $('firstName').value + " " +$('lastName').value; + var fullName = jQuery('#firstName').val() + " " +jQuery('#lastName').val(); var extension = ""; - if ($F('shipToExtension')) { - extension = "-" + $F('shipToExtension'); + if (jQuery('#shipToExtension').val()) { + extension = "-" + jQuery('#shipToExtension').val(); } - var shippingContactPhoneNumber = $F('shipToCountryCode')+ "-" + $F('shipToAreaCode') - + "-" + $F('shipToContactNumber') + extension; - $('completedShipToAttn').update("Attn: " + fullName); - $('completedShippingContactNumber').update(shippingContactPhoneNumber); - $('completedEmailAddress').update($('emailAddress').value); - $('completedShipToAddress1').update($F('shipToAddress1')); - $('completedShipToAddress2').update($('shipToAddress2').value); - if ($('shipToStateProvinceGeoId').value == "_NA_") { - var shipToGeo = $('shipToCity').value+", "+$('shipToCountryGeoId').value+" "+$('shipToPostalCode').value; + var shippingContactPhoneNumber = jQuery('#shipToCountryCode').val()+ "-" + jQuery('#shipToAreaCode').val() + + "-" + jQuery('#shipToContactNumber').val() + extension; + jQuery('#completedShipToAttn').html("Attn: " + fullName); + jQuery('#completedShippingContactNumber').html(shippingContactPhoneNumber); + jQuery('#completedEmailAddress').html(jQuery('#emailAddress').val()); + jQuery('#completedShipToAddress1').html(jQuery('#shipToAddress1').val()); + jQuery('#completedShipToAddress2').html(jQuery('#shipToAddress2').val()); + if (jQuery('#shipToStateProvinceGeoId').val() == "_NA_") { + var shipToGeo = jQuery('#shipToCity').val()+", "+jQuery('#shipToCountryGeoId').val()+" "+jQuery('#shipToPostalCode').val(); } else { - var shipToGeo = $('shipToCity').value+","+$('shipToStateProvinceGeoId').value +" "+$('shipToCountryGeoId').value+" "+$('shipToPostalCode').value; + var shipToGeo = jQuery('#shipToCity').val()+","+jQuery('#shipToStateProvinceGeoId').val() +" "+jQuery('#shipToCountryGeoId').val()+" "+jQuery('#shipToPostalCode').val(); } - $('completedShipToGeo').update(shipToGeo); + jQuery('#completedShipToGeo').html(shipToGeo); // set shipToContactMechId in Billing form. - $('shipToContactMechIdInBillingForm').value = $F('shipToContactMechId'); + jQuery('#shipToContactMechIdInBillingForm').val(jQuery('#shipToContactMechId').val()); } function updateBillingSummary() { - var fullName = $F('firstNameOnCard') + " " +$F('lastNameOnCard'); - $('completedBillToAttn').update("Attn: " + fullName); + var fullName = jQuery('#firstNameOnCard').val() + " " +jQuery('#lastNameOnCard').val(); + jQuery('#completedBillToAttn').html("Attn: " + fullName); var extension = ""; - if ($F('billToExtension')) { - extension = "-" + $F('billToExtension'); + if (jQuery('#billToExtension').val()) { + extension = "-" + jQuery('#billToExtension').val(); } - var billToPhoneNumber = $F('billToCountryCode') + "-" + $F('billToAreaCode') + "-" + $F('billToContactNumber') + extension; - $('completedBillToPhoneNumber').update(billToPhoneNumber); - var cardNumber = "CC#:XXXXXXXXXXXX"+$F('cardNumber').gsub('-','').slice(12,16); - $('completedCCNumber').update(cardNumber); - var expiryDate = "Expires:"+$F('expMonth')+"/"+$F('expYear'); - $('completedExpiryDate').update(expiryDate); - $('completedBillToAddress1').update($F('billToAddress1')); - $('completedBillToAddress2').update($F('billToAddress2')); - if ($F('billToStateProvinceGeoId') == "_NA_") { - var billToGeo = $F('billToCity')+", "+$F('billToCountryGeoId')+" "+$F('billToPostalCode'); + var billToPhoneNumber = jQuery('#billToCountryCode').val() + "-" + jQuery('#billToAreaCode').val() + "-" + jQuery('#billToContactNumber').val() + extension; + jQuery('#completedBillToPhoneNumber').html(billToPhoneNumber); + var cardNumber = "CC#:XXXXXXXXXXXX"+jQuery('#cardNumber').val().replace('-','').slice(12,16); + jQuery('#completedCCNumber').html(cardNumber); + var expiryDate = "Expires:"+jQuery('#expMonth').val()+"/"+jQuery('#expYear').val(); + jQuery('#completedExpiryDate').html(expiryDate); + jQuery('#completedBillToAddress1').html(jQuery('#billToAddress1').val()); + jQuery('#completedBillToAddress2').html(jQuery('#billToAddress2').val()); + if (jQuery('#billToStateProvinceGeoId').val() == "_NA_") { + var billToGeo = jQuery('#billToCity').val()+", "+jQuery('#billToCountryGeoId').val()+" "+jQuery('#billToPostalCode').val(); } else { - var billToGeo = $F('billToCity')+", "+$F('billToStateProvinceGeoId') +" "+$F('billToCountryGeoId')+" "+$F('billToPostalCode'); + var billToGeo = jQuery('#billToCity').val()+", "+jQuery('#billToStateProvinceGeoId').val() +" "+jQuery('#billToCountryGeoId')+" "+jQuery('#billToPostalCode').val(); } - $('completedBillToGeo').update(billToGeo); - $('paymentMethod').update($F('paymentMethodTypeId')); - $('billToContactMechIdInShipingForm').value = $F('billToContactMechId'); + jQuery('#completedBillToGeo').html(billToGeo); + jQuery('#paymentMethod').html(jQuery('#paymentMethodTypeId').val()); + jQuery('#billToContactMechIdInShipingForm').val(jQuery('#billToContactMechId')); } Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/images/productAdditionalView.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/images/productAdditionalView.js?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/images/productAdditionalView.js (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/images/productAdditionalView.js Fri Dec 10 20:40:08 2010 @@ -32,12 +32,12 @@ imgView = { } }, showDetailImage: function() { - var mainImage = $('detailImage'); - mainImage.src = $F('originalImage'); + var mainImage = document.getElementById('detailImage'); + mainImage.src = document.getElementById('originalImage').value; return false; }, showImage: function() { - var mainImage = $('detailImage'); + var mainImage = document.getElementById('detailImage'); mainImage.src = this.getAttributeNode('swapDetail').value; return false; }, @@ -53,4 +53,4 @@ imgView = { } } } -document.observe('dom:loaded', imgView.init, false); +jQuery(document).ready(imgView.init); Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/images/profile.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/images/profile.js?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/images/profile.js (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/images/profile.js Fri Dec 10 20:40:08 2010 @@ -17,97 +17,97 @@ specific language governing permissions under the License. */ -var validateNewUser = null; -var validateEditUser = null; -var validatePostalAddress = null; -document.observe('dom:loaded', function() { - if ($('newUserForm')) { - validateNewUser = new Validation('newUserForm', {immediate: true, onSubmit: false}); - addValidations(); - Event.observe($('emailAddress'), 'change', setUserNameFromEmail); +jQuery(document).ready( function() { + + // register a new user/customer + if (document.getElementById('newUserForm')) { + jQuery("#newUserForm").validate(); + + jQuery("#emailAddress").change(setUserNameFromEmail); useShippingAddressAsBillingToggle(); - Event.observe('useShippingAddressForBilling', 'click', useShippingAddressAsBillingToggle); - Event.observe($('submitNewUserForm'), 'click', submitValidNewUser); + + jQuery("#useShippingAddressForBilling").click(useShippingAddressAsBillingToggle); + jQuery("#submitNewUserForm").click(submitValidNewUser); // Get associate states for Shipping Information - Event.observe($('shipToCountryGeoId'), 'change', function(){ + jQuery("#shipToCountryGeoId").change( function(){ getAssociatedStateList('shipToCountryGeoId', 'shipToStateProvinceGeoId', 'advice-required-shipToStateProvinceGeoId', 'shipToStates'); }); // Get associate states for Billing Information - Event.observe($('billToCountryGeoId'), 'change', function() { + jQuery("#billToCountryGeoId").change( function(){ getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId', 'advice-required-billToStateProvinceGeoId', 'billToStates'); }); getAssociatedStateList('shipToCountryGeoId', 'shipToStateProvinceGeoId', 'advice-required-shipToStateProvinceGeoId', 'shipToStates'); getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId', 'advice-required-billToStateProvinceGeoId', 'billToStates'); } - if ($('editUserForm')) { - validateEditUser = new Validation('editUserForm', {immediate: true, onSubmit: false}); - Event.observe($('submitEditUserForm'), 'click', submitValidEditUser); - } - if (!$('newUserForm') && !$('editUserForm')) { - if ($('emailAddress')) { - inPlaceEditEmail('emailAddress'); - } - } - if ($('addAddress')) { - validatePostalAddress = new Validation('createPostalAddressForm', {immediate: true, onSubmit: false}); - } - if ($('submitPostalAddressForm')) { - Event.observe($('submitPostalAddressForm'), 'click', submitValidPostalAddress); + + // edit user information form validation + if (document.getElementById('editUserForm')) { + jQuery("#editUserForm").validate(); + } + + // add Address validation + if (document.getElementById('addAddress')) { + jQuery("#createPostalAddressForm").validate(); } - if ($('shipToPhoneRequired')) { - Event.observe($('shipToCountryCode'), 'blur', function() { + // special validation on blur for phone number fields + if (document.getElementById('shipToPhoneRequired')) { + jQuery("#shipToCountryCode").blur( function() { validatePhoneNumber('shipToPhoneRequired', 'shipToCountryCode', 'shipToAreaCode', 'shipToContactNumber'); }); - Event.observe($('shipToAreaCode'), 'blur', function() { + jQuery("#shipToAreaCode").blur( function() { validatePhoneNumber('shipToPhoneRequired', 'shipToAreaCode', 'shipToCountryCode', 'shipToContactNumber'); }); - Event.observe($('shipToContactNumber'), 'blur', function() { + jQuery("#shipToContactNumber").blur( function() { validatePhoneNumber('shipToPhoneRequired', 'shipToContactNumber', 'shipToCountryCode', 'shipToAreaCode'); }); } - if ($('billToPhoneRequired')) { - Event.observe($('billToCountryCode'), 'blur', function() { + if (document.getElementById('billToPhoneRequired')) { + jQuery("#billToCountryCode").blur( function() { validatePhoneNumber('billToPhoneRequired', 'billToCountryCode', 'billToAreaCode', 'billToContactNumber'); }); - Event.observe($('billToAreaCode'), 'blur', function() { + jQuery("#billToAreaCode").blur( function() { validatePhoneNumber('billToPhoneRequired', 'billToAreaCode', 'billToCountryCode', 'billToContactNumber'); }); - Event.observe($('billToContactNumber'), 'blur', function() { + jQuery("#billToContactNumber").blur( function() { validatePhoneNumber('billToPhoneRequired', 'billToContactNumber', 'billToCountryCode', 'billToAreaCode'); }); } - if ($('createPostalAddressForm')) { + + // postal address validation and geo autocomplete + if (document.getElementById('createPostalAddressForm')) { + jQuery("#createPostalAddressForm").validate(); + // Get associate states for Postal Address Information - Event.observe($('countryGeoId'), 'change', function() { + jQuery("#countryGeoId").change( function() { getAssociatedStateList('countryGeoId', 'stateProvinceGeoId', 'advice-required-stateProvinceGeoId', 'states'); }); getAssociatedStateList('countryGeoId', 'stateProvinceGeoId', 'advice-required-stateProvinceGeoId', 'states'); } - if ($('editBillToPostalAddress')) { + if (document.getElementById('editBillToPostalAddress')) { // Get associate states for Billing Information - Event.observe($('billToCountryGeoId'), 'change', function() { + jQuery("#billToCountryGeoId").change( function() { getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId', 'advice-required-billToStateProvinceGeoId', 'billToStates'); }); - if($('billToStateProvinceGeoId').value == "_NA_"){ + if(document.getElementById('billToStateProvinceGeoId').value == "_NA_"){ getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId', 'advice-required-billToStateProvinceGeoId', 'billToStates'); } else { - stateValue = $('billToStateProvinceGeoId').value; + stateValue = document.getElementById('billToStateProvinceGeoId').value; getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId', 'advice-required-billToStateProvinceGeoId', 'billToStates'); - $('billToStateProvinceGeoId').value = stateValue; + document.getElementById('billToStateProvinceGeoId').value = stateValue; } } - if ($('editShipToPostalAddress')) { + if (document.getElementById ('editShipToPostalAddress')) { // Get associate states for Shipping Information - Event.observe($('shipToCountryGeoId'), 'change', function(){ + jQuery("#shipToCountryGeoId").change( function() { getAssociatedStateList('shipToCountryGeoId', 'shipToStateProvinceGeoId', 'advice-required-shipToStateProvinceGeoId', 'shipToStates'); }); - if($('shipToStateProvinceGeoId').value == "_NA_"){ + if(document.getElementById('shipToStateProvinceGeoId').value == "_NA_"){ getAssociatedStateList('shipToCountryGeoId', 'shipToStateProvinceGeoId', 'advice-required-shipToStateProvinceGeoId', 'shipToStates'); } else { - var stateValue = $('shipToStateProvinceGeoId').value; + var stateValue = document.getElementById('shipToStateProvinceGeoId').value; getAssociatedStateList('shipToCountryGeoId', 'shipToStateProvinceGeoId', 'advice-required-shipToStateProvinceGeoId', 'shipToStates'); - $('shipToStateProvinceGeoId').value = stateValue; + document.getElementById('shipToStateProvinceGeoId').value = stateValue; } } }); @@ -120,66 +120,62 @@ document.observe('dom:loaded', function( * 3) textToCheck1, textToCheck2 : Other text boxes to be check. */ function validatePhoneNumber(errorDivId, focusedTextId, textToCheck1, textToCheck2) { - if (($(focusedTextId).value == "")) { - Effect.Appear(errorDivId, {duration: 0.5}); - } else if (($(textToCheck1).value != "") && ($(textToCheck2).value != "" )) { - Effect.Fade(errorDivId, {duration: 0.5}); + if ((document.getElementById(focusedTextId).value == "")) { + jQuery("#" + errorDivId).fadeIn("fast"); + } else if ((document.getElementById(textToCheck1).value != "") && (document.getElementById(textToCheck2).value != "" )) { + jQuery("#" + errorDivId).fadeOut("fast"); } } function submitValidNewUser() { + validatePhoneNumber('shipToPhoneRequired', 'shipToContactNumber', 'shipToCountryCode', 'shipToAreaCode'); validatePhoneNumber('billToPhoneRequired', 'billToContactNumber', 'billToCountryCode', 'billToAreaCode'); - if (validateNewUser.validate()) { - $('newUserForm').submit(); + if (jQuery("#newUserForm").valid()) { + document.getElementById('newUserForm').submit(); } } function submitValidEditUser() { - if (validateEditUser.validate()) { - $('editUserForm').submit(); - } + document.getElementById('editUserForm').submit(); } function submitValidPostalAddress() { - if (validatePostalAddress.validate()) { - $('createPostalAddressForm').submit(); - } + document.getElementById('createPostalAddressForm').submit(); } function setUserNameFromEmail() { - if ($('username').value == "") { - $('username').value = $F('emailAddress'); + if (document.getElementById('username').value == "") { + document.getElementById('username').value = document.getElementById('emailAddress').value; } } function useShippingAddressAsBillingToggle() { - if ($('useShippingAddressForBilling').checked) { - $('billToAddress1').value = $F('shipToAddress1'); - $('billToAddress2').value = $F('shipToAddress2'); - $('billToCity').value = $F('shipToCity'); - $('billToCountryGeoId').value = $F('shipToCountryGeoId'); + if (document.getElementById('useShippingAddressForBilling').checked) { + document.getElementById('billToAddress1').value = document.getElementById('shipToAddress1').value; + document.getElementById('billToAddress2').value = document.getElementById('shipToAddress2').value; + document.getElementById('billToCity').value = document.getElementById('shipToCity').value; + document.getElementById('billToCountryGeoId').value = document.getElementById('shipToCountryGeoId').value; getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId', 'advice-required-billToStateProvinceGeoId', 'billToStates'); - $('billToStateProvinceGeoId').value = $F('shipToStateProvinceGeoId'); - $('billToPostalCode').value = $F('shipToPostalCode'); + document.getElementById('billToStateProvinceGeoId').value = document.getElementById('shipToStateProvinceGeoId').value; + document.getElementById('billToPostalCode').value = document.getElementById('shipToPostalCode').value; - $('billToAddress1').disabled = true ; - $('billToAddress2').disabled = true ; - $('billToCity').disabled = true ; - $('billToCountryGeoId').disabled = true ; - $('billToStateProvinceGeoId').disabled = true ; - $('billToPostalCode').disabled = true; + document.getElementById('billToAddress1').disabled = true ; + document.getElementById('billToAddress2').disabled = true ; + document.getElementById('billToCity').disabled = true ; + document.getElementById('billToCountryGeoId').disabled = true ; + document.getElementById('billToStateProvinceGeoId').disabled = true ; + document.getElementById('billToPostalCode').disabled = true; copyShipToBillAddress(); hideErrorMessage(); } else { - validBillingAddress(); stopObservingShipToBillAddress(); - $('billToAddress1').disabled = false ; - $('billToAddress2').disabled = false ; - $('billToCity').disabled = false ; - $('billToCountryGeoId').disabled = false ; - $('billToStateProvinceGeoId').disabled = false ; - $('billToPostalCode').disabled = false; + document.getElementById('billToAddress1').disabled = false ; + document.getElementById('billToAddress2').disabled = false ; + document.getElementById('billToCity').disabled = false ; + document.getElementById('billToCountryGeoId').disabled = false ; + document.getElementById('billToStateProvinceGeoId').disabled = false ; + document.getElementById('billToPostalCode').disabled = false; } } @@ -189,11 +185,13 @@ function getServerError(data) { if (data._ERROR_MESSAGE_LIST_ != undefined) { serverErrorHash = data._ERROR_MESSAGE_LIST_; - serverErrorHash.each(function(error) { - if (error.message != undefined) { - serverError += error.message; + alert(serverErrorHash); + jQuery.each(serverErrorHash, function(error, message){ + if (error != undefined) { + serverError += message; } }); + if (serverError == "") { serverError = serverErrorHash; } @@ -204,112 +202,59 @@ function getServerError(data) { return serverError; } -function inPlaceEditEmail(e) { - if ($('updatedEmailContactMechId')) { - var url = 'updatePartyEmailAddress?contactMechId='+ $('updatedEmailContactMechId').value; - var errorId = 'serverError_' + $('updatedEmailContactMechId').value; - var oldEmailAddress = $('updatedEmailAddress').value; - var editor = new Ajax.InPlaceEditor(e, url, {clickToEditText: 'click here to change your email', paramName: 'emailAddress', htmlResponse: false, updateAfterRequestCall: true, - onComplete: function (transport) { - if (transport != undefined) { - var data = transport.responseText.evalJSON(true); - var serverError = getServerError(data); - if (serverError != "") { - Effect.Appear(errorId); - $(errorId).update(serverError); - $('emailAddress').update(oldEmailAddress); - } else { - Effect.Fade(errorId); - if (data.contactMechId != undefined) { - $('updatedEmailContactMechId').value = data.contactMechId; - $('updatedEmailAddress').value = data.emailAddress; - } else { - $('emailAddress').update(oldEmailAddress); - } - inPlaceEditEmail('emailAddress'); - $(errorId).id = 'serverError_' + $('updatedEmailContactMechId').value; - editor.dispose(); - } +function doAjaxRequest(formId, errorId, popupId, requestUrl) { + if (jQuery("#" + formId).valid()) { + jQuery.ajax({ + url: requestUrl, + type: 'POST', + async: false, + data: jQuery("#" + formId).serialize(), + success: function(data) { + var serverError = getServerError(data); + if (serverError != "") { + jQuery("#" + errorId).fadeIn("fast"); + jQuery("#" + popupId).fadeIn("fast"); + jQuery("#" + errorId).html(serverError); + } else { + jQuery("#" + errorId).fadeIn("slow"); + jQuery("#" + popupId).fadeIn("slow"); + document.getElementById('refreshRequestForm').submit(); } } + }); + } } function createPartyPostalAddress(e) { formId = 'createPostalAddressForm'; - var validateEditPostalAddress = new Validation(formId, {immediate: true, onSubmit: false}); errorId = 'serverError'; popupId = 'displayCreateAddressForm'; - if (validateEditPostalAddress.validate()) { - new Ajax.Request('createPartyPostalAddress', { - asynchronous: false, - onSuccess: function(transport) { - var data = transport.responseText.evalJSON(true); - var serverError = getServerError(data); - if (serverError != "") { - Effect.Appear(errorId); - Effect.Appear(popupId); - $(errorId).update(serverError); - } else { - Effect.Fade(popupId); - Effect.Fade(errorId); - $('refreshRequestForm').submit(); - } - }, parameters: $(formId).serialize(), requestHeaders: {Accept: 'application/json'} - }); - } + requestUrl = 'createPartyPostalAddress'; + + doAjaxRequest(formId, errorId, popupId, requestUrl); + + } function updatePartyPostalAddress(e) { contactMechId = e.split('_')[1]; formId = 'editPostalAddress_' + contactMechId; - var validateEditPostalAddress = new Validation(formId, {immediate: true, onSubmit: false}); errorId = 'serverError_' + contactMechId; popupId = 'displayEditAddressForm_' + contactMechId; - if (validateEditPostalAddress.validate()) { - new Ajax.Request('updatePartyPostalAddress', { - asynchronous: false, - onSuccess: function(transport) { - var data = transport.responseText.evalJSON(true); - var serverError = getServerError(data); - if (serverError != "") { - Effect.Appear(errorId); - Effect.Appear(popupId); - $(errorId).update(serverError); - } else { - Effect.Fade(popupId); - Effect.Fade(errorId); - $('refreshRequestForm').submit(); - } - }, parameters: $(formId).serialize(), requestHeaders: {Accept: 'application/json'} - }); - } + requestUrl = 'updatePartyPostalAddress'; + + doAjaxRequest(formId, errorId, popupId, requestUrl); } function updatePartyShipToPostalAddress(e) { formId = 'editShipToPostalAddress'; - var validateEditPostalAddress = new Validation(formId, {immediate: true, onSubmit: false}); errorId = 'shipToServerError'; popupId = 'displayEditShipToPostalAddress'; - if (validateEditPostalAddress.validate()) { - new Ajax.Request('updatePartyPostalAddress', { - asynchronous: false, - onSuccess: function(transport) { - var data = transport.responseText.evalJSON(true); - var serverError = getServerError(data); - if (serverError != "") { - Effect.Appear(errorId); - Effect.Appear(popupId); - $(errorId).update(serverError); - } else { - Effect.Fade(popupId); - Effect.Fade(errorId); - $('refreshRequestForm').submit(); - } - }, parameters: $(formId).serialize(), requestHeaders: {Accept: 'application/json'} - }); - } + requestUrl = 'updatePartyPostalAddress'; + + doAjaxRequest(formId, errorId, popupId, requestUrl); } function updatePartyBillToPostalAddress(e) { @@ -317,119 +262,67 @@ function updatePartyBillToPostalAddress( var validateEditPostalAddress = new Validation(formId, {immediate: true, onSubmit: false}); errorId = 'billToServerError'; popupId = 'displayEditBillToPostalAddress'; - if (validateEditPostalAddress.validate()) { - new Ajax.Request('updatePartyPostalAddress', { - asynchronous: false, - onSuccess: function(transport) { - var data = transport.responseText.evalJSON(true); - var serverError = getServerError(data); - if (serverError != "") { - Effect.Appear(errorId); - Effect.Appear(popupId); - $(errorId).update(serverError); - } else { - Effect.Fade(popupId); - Effect.Fade(errorId); - $('refreshRequestForm').submit(); - } - }, parameters: $(formId).serialize(), requestHeaders: {Accept: 'application/json'} - }); - } -} - -function validBillingAddress () { - Event.observe($('billToAddress1'), 'blur', function() { - if ($('billToAddress1').value == "") { - Effect.Appear('advice-required-billToAddress1'); - } - }); - Event.observe($('billToStateProvinceGeoId'), 'blur', function() { - if ($('billToStateProvinceGeoId').value == "") { - Effect.Appear('advice-required-billToStateProvinceGeoId'); - } - }); - Event.observe($('billToCity'), 'blur', function() { - if ($('billToCity').value == "") { - Effect.Appear('advice-required-billToCity'); - } - }); - Event.observe($('billToPostalCode'), 'blur', function() { - if ($('billToPostalCode').value == "") { - Effect.Appear('advice-required-billToPostalCode'); - } - }); - Event.observe($('billToCountryGeoId'), 'blur', function() { - if ($('billToCountryGeoId').value == "") { - Effect.Appear('advice-required-billToCountryGeoId'); - } - }); + requestUrl = 'updatePartyPostalAddress'; + + doAjaxRequest(formId, errorId, popupId, requestUrl); } function hideErrorMessage() { - Effect.Fade('advice-required-billToAddress1'); - Effect.Fade('advice-required-billToStateProvinceGeoId'); - Effect.Fade('advice-required-billToCity'); - Effect.Fade('advice-required-billToPostalCode'); - Effect.Fade('advice-required-billToCountryGeoId'); - Effect.Fade('billToPhoneRequired'); + jQuery('#advice-required-billToAddress1').fadeOut("fast"); + jQuery('#advice-required-billToStateProvinceGeoId').fadeOut("fast"); + jQuery('#advice-required-billToCity').fadeOut("fast"); + jQuery('#advice-required-billToPostalCode').fadeOut("fast");; + jQuery('#advice-required-billToCountryGeoId').fadeOut("fast"); + jQuery('#billToPhoneRequired').fadeOut("fast"); } function copyShipToBillAddress() { - Event.observe($('shipToAddress1'), 'change', function() { - $('billToAddress1').value = $F('shipToAddress1') - }); - Event.observe($('shipToAddress2'), 'change', function() { - $('billToAddress2').value = $F('shipToAddress2') + jQuery("#shipToAddress1").change( function() { + document.getElementById('billToAddress1').value = document.getElementById('shipToAddress1').value; }); - Event.observe($('shipToCity'), 'change', function() { - $('billToCity').value = $F('shipToCity') + jQuery("#shipToAddress2").change( function() { + document.getElementById('billToAddress2').value = document.getElementById('shipToAddress2').value; }); - Event.observe($('shipToStateProvinceGeoId'), 'change', function() { - $('billToStateProvinceGeoId').value = $F('shipToStateProvinceGeoId') + jQuery("#shipToCity").change( function() { + document.getElementById('billToCity').value = document.getElementById('shipToCity').value; }); - Event.observe($('shipToCountryGeoId'), 'change', copyShipToCountryToBillToCountry); - Event.observe($('shipToPostalCode'), 'change', function() { - $('billToPostalCode').value = $F('shipToPostalCode') + jQuery("#shipToStateProvinceGeoId").change( function() { + document.getElementById('billToStateProvinceGeoId').value = document.getElementById('shipToStateProvinceGeoId').value; + }); + + jQuery("#shipToCountryGeoId").change(copyShipToCountryToBillToCountry); + jQuery("#shipToPostalCode").change( function() { + document.getElementById('billToPostalCode').value = document.getElementById('shipToPostalCode').value; }); } function stopObservingShipToBillAddress() { - Event.stopObserving($('shipToAddress1'), 'change', ""); - Event.stopObserving($('shipToAddress2'), 'change', ""); - Event.stopObserving($('shipToCity'), 'change', ""); - Event.stopObserving($('shipToStateProvinceGeoId'), 'change', ""); - Event.stopObserving($('shipToCountryGeoId'), 'change', copyShipToCountryToBillToCountry); - Event.stopObserving($('shipToPostalCode'), 'change', ""); -} - -function addValidations() { - Validation.add('validate-password', "", { - minLength : 5, - notOneOf : ['password','PASSWORD'], - notEqualToField : 'username' - }); - Validation.add('validate-passwordVerify', "", { - equalToField : 'password' - }); + jQuery('#shipToAddress1').unbind('change'); + jQuery('shipToAddress2').unbind('change'); + jQuery('shipToCity').unbind('change'); + jQuery('shipToStateProvinceGeoId').unbind('change'); + jQuery('shipToCountryGeoId').unbind('change', copyShipToCountryToBillToCountry); + jQuery('shipToPostalCode').unbind('change'); } function showState(id) { - if ($('editPostalAddress_'+id)) { + if (document.getElementById('editPostalAddress_' + id)) { // Get associate states for Postal Address Information - Event.observe($('countryGeoId_'+id), 'change', function() { + jQuery("#countryGeoId_" + id).change( function() { getAssociatedStateList('countryGeoId_'+id, 'stateProvinceGeoId_'+id, 'advice-required-stateProvinceGeoId_'+id, 'states_'+id); }); - if ($('stateProvinceGeoId_'+id).value == "_NA_") { + + if (document.getElementById('stateProvinceGeoId_'+id).value == "_NA_") { getAssociatedStateList('countryGeoId_'+id, 'stateProvinceGeoId_'+id, 'advice-required-stateProvinceGeoId_'+id, 'states_'+id); } else { - var stateValue = $('stateProvinceGeoId_'+id).value; + var stateValue = document.getElementById('stateProvinceGeoId_'+id).value; getAssociatedStateList('countryGeoId_'+id, 'stateProvinceGeoId_'+id, 'advice-required-stateProvinceGeoId_'+id, 'states_'+id); - $('stateProvinceGeoId_'+id).value = stateValue; + document.getElementById('stateProvinceGeoId_'+id).value = stateValue; } } } function copyShipToCountryToBillToCountry(){ - $('billToCountryGeoId').value = $F('shipToCountryGeoId'); + document.getElementById('billToCountryGeoId').value = document.getElementById('shipToCountryGeoId').value; getAssociatedStateList('billToCountryGeoId', 'billToStateProvinceGeoId', 'advice-required-billToStateProvinceGeoId', 'billToStates'); } \ No newline at end of file Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/images/quickAnonCustSettings.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/images/quickAnonCustSettings.js?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/images/quickAnonCustSettings.js (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/images/quickAnonCustSettings.js Fri Dec 10 20:40:08 2010 @@ -17,41 +17,41 @@ specific language governing permissions under the License. */ -document.observe('dom:loaded', isValidElement); +jQuery(document).ready(isValidElement); function isValidElement(element){ - var validator = new Validation('quickAnonProcessCustomer', {immediate : true}); + jQuery('#quickAnonProcessCustomer').validate(); } -document.observe('dom:loaded', function() { - Event.observe('useShippingPostalAddressForBilling', 'click', changeText2); +jQuery(document).ready(function() { + jQuery('#useShippingPostalAddressForBilling').click(changeText2); }); function changeText2(){ - if($('useShippingPostalAddressForBilling').checked) { - $('billToName').value = $F('shipToName'); - $('billToAttnName').value = $F('shipToAttnName'); - $('billToAddress1').value = $F('shipToAddress1'); - $('billToAddress2').value = $F('shipToAddress2'); - $('billToCity').value = $F('shipToCity'); - $('billToStateProvinceGeoId').value = $F('shipToStateProvinceGeoId'); - $('billToPostalCode').value = $F('shipToPostalCode'); - $('billToCountryGeoId').value = $F('shipToCountryGeoId'); - $('billToName').disabled = true; - $('billToAttnName').disabled = true; - $('billToAddress1').disabled = true; - $('billToAddress2').disabled = true; - $('billToCity').disabled = true; - $('billToStateProvinceGeoId').disabled = true; - $('billToPostalCode').disabled = true; - $('billToCountryGeoId').disabled = true; + if(document.getElementById('useShippingPostalAddressForBilling').checked) { + document.getElementById('billToName').value = document.getElementById('shipToName').value; + document.getElementById('billToAttnName').value = document.getElementById('shipToAttnName').value; + document.getElementById('billToAddress1').value = document.getElementById('shipToAddress1').value; + document.getElementById('billToAddress2').value = document.getElementById('shipToAddress2').value; + document.getElementById('billToCity').value = document.getElementById('shipToCity').value; + document.getElementById('billToStateProvinceGeoId').value = document.getElementById('shipToStateProvinceGeoId').value; + document.getElementById('billToPostalCode').value = document.getElementById('shipToPostalCode').value; + document.getElementById('billToCountryGeoId').value = document.getElementById('shipToCountryGeoId').value; + document.getElementById('billToName').disabled = true; + document.getElementById('billToAttnName').disabled = true; + document.getElementById('billToAddress1').disabled = true; + document.getElementById('billToAddress2').disabled = true; + document.getElementById('billToCity').disabled = true; + document.getElementById('billToStateProvinceGeoId').disabled = true; + document.getElementById('billToPostalCode').disabled = true; + document.getElementById('billToCountryGeoId').disabled = true; } else { - $('billToName').disabled = false; - $('billToAttnName').disabled = false; - $('billToAddress1').disabled = false; - $('billToAddress2').disabled = false; - $('billToCity').disabled = false; - $('billToStateProvinceGeoId').disabled = false; - $('billToPostalCode').disabled = false; - $('billToCountryGeoId').disabled = false; + document.getElementById('billToName').disabled = false; + document.getElementById('billToAttnName').disabled = false; + document.getElementById('billToAddress1').disabled = false; + document.getElementById('billToAddress2').disabled = false; + document.getElementById('billToCity').disabled = false; + document.getElementById('billToStateProvinceGeoId').disabled = false; + document.getElementById('billToPostalCode').disabled = false; + document.getElementById('billToCountryGeoId').disabled = false; } } \ No newline at end of file Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/includes/headerHead.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/includes/headerHead.ftl?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/includes/headerHead.ftl (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/includes/headerHead.ftl Fri Dec 10 20:40:08 2010 @@ -88,9 +88,4 @@ under the License. <#if metaKeywords?exists> <meta name="keywords" content="${metaKeywords}"/> </#if> - <#if requireDojo?exists> - <script type="text/javascript"> - dojo.require("dojo.widget.*"); - </script> - </#if> </head> 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=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/order/OnePageCheckoutProcess.ftl Fri Dec 10 20:40:08 2010 @@ -624,6 +624,7 @@ under the License. </div> </div> </fieldset> + <br style="clear:both;"/> <fieldset> <a href="javascript:void(0);" class="button" id="savePaymentAndBillingContact">${uiLabelMap.EcommerceContinueToStep} 5</a> <a href="javascript:void(0);" class="button" style="display: none;" id="processingOrderSubmitPanel">${uiLabelMap.EcommercePleaseWait}....</a> Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/order/checkoutpayment.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/order/checkoutpayment.ftl?rev=1044503&r1=1044502&r2=1044503&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/order/checkoutpayment.ftl (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/order/checkoutpayment.ftl Fri Dec 10 20:40:08 2010 @@ -74,10 +74,10 @@ function submitForm(form, mode, value) { <div> <label>${uiLabelMap.CommonAdd}:</label> <#if productStorePaymentMethodTypeIdMap.CREDIT_CARD?exists> - <a href="javascript:submitForm($('checkoutInfoForm'), 'NC', '');" class="button">${uiLabelMap.AccountingCreditCard}</a> + <a href="javascript:submitForm(document.getElementById('checkoutInfoForm'), 'NC', '');" class="button">${uiLabelMap.AccountingCreditCard}</a> </#if> <#if productStorePaymentMethodTypeIdMap.EFT_ACCOUNT?exists> - <a href="javascript:submitForm($('checkoutInfoForm'), 'NE', '');" class="button">${uiLabelMap.AccountingEFTAccount}</a> + <a href="javascript:submitForm(document.getElementById('checkoutInfoForm'), 'NE', '');" class="button">${uiLabelMap.AccountingEFTAccount}</a> </#if> <#if productStorePaymentMethodTypeIdMap.EXT_OFFLINE?exists> </div> @@ -134,7 +134,7 @@ function submitForm(form, mode, value) { <input type="checkbox" id="checkOutPayment_${paymentMethod.paymentMethodId}" name="checkOutPaymentId" value="${paymentMethod.paymentMethodId}" <#if cart.isPaymentSelected(paymentMethod.paymentMethodId)>checked="checked"</#if> /> <label for="checkOutPayment_${paymentMethod.paymentMethodId}">${uiLabelMap.AccountingGift}:${giftCardNumber}</label> <#if paymentMethod.description?has_content>(${paymentMethod.description})</#if> - <a href="javascript:submitForm($('checkoutInfoForm'), 'EG', '${paymentMethod.paymentMethodId}');" class="button">${uiLabelMap.CommonUpdate}</a> + <a href="javascript:submitForm(document.getElementById('checkoutInfoForm'), 'EG', '${paymentMethod.paymentMethodId}');" class="button">${uiLabelMap.CommonUpdate}</a> <strong>${uiLabelMap.OrderBillUpTo}:</strong> <input type="text" size="5" class="inputBox" name="amount_${paymentMethod.paymentMethodId}" value="<#if (cart.getPaymentAmount(paymentMethod.paymentMethodId)?default(0) > 0)>${cart.getPaymentAmount(paymentMethod.paymentMethodId)?string("##0.00")}</#if>" /> </div> </#if> @@ -145,7 +145,7 @@ function submitForm(form, mode, value) { <input type="checkbox" id="checkOutPayment_${paymentMethod.paymentMethodId}" name="checkOutPaymentId" value="${paymentMethod.paymentMethodId}" <#if cart.isPaymentSelected(paymentMethod.paymentMethodId)>checked="checked"</#if> /> <label for="checkOutPayment_${paymentMethod.paymentMethodId}">CC:${Static["org.ofbiz.party.contact.ContactHelper"].formatCreditCard(creditCard)}</label> <#if paymentMethod.description?has_content>(${paymentMethod.description})</#if> - <a href="javascript:submitForm($('checkoutInfoForm'), 'EC', '${paymentMethod.paymentMethodId}');" class="button">${uiLabelMap.CommonUpdate}</a> + <a href="javascript:submitForm(document.getElementById('checkoutInfoForm'), 'EC', '${paymentMethod.paymentMethodId}');" class="button">${uiLabelMap.CommonUpdate}</a> <label for="amount_${paymentMethod.paymentMethodId}"><strong>${uiLabelMap.OrderBillUpTo}:</strong></label><input type="text" size="5" class="inputBox" id="amount_${paymentMethod.paymentMethodId}" name="amount_${paymentMethod.paymentMethodId}" value="<#if (cart.getPaymentAmount(paymentMethod.paymentMethodId)?default(0) > 0)>${cart.getPaymentAmount(paymentMethod.paymentMethodId)?string("##0.00")}</#if>" /> </div> </#if> @@ -156,7 +156,7 @@ function submitForm(form, mode, value) { <input type="radio" id="checkOutPayment_${paymentMethod.paymentMethodId}" name="checkOutPaymentId" value="${paymentMethod.paymentMethodId}" <#if paymentMethod.paymentMethodId == checkOutPaymentId>checked="checked"</#if> /> <label for="checkOutPayment_${paymentMethod.paymentMethodId}">${uiLabelMap.AccountingEFTAccount}:${eftAccount.bankName?if_exists}: ${eftAccount.accountNumber?if_exists}</label> <#if paymentMethod.description?has_content><p>(${paymentMethod.description})</p></#if> - <a href="javascript:submitForm($('checkoutInfoForm'), 'EE', '${paymentMethod.paymentMethodId}');" class="button">${uiLabelMap.CommonUpdate}</a> + <a href="javascript:submitForm(document.getElementById('checkoutInfoForm'), 'EE', '${paymentMethod.paymentMethodId}');" class="button">${uiLabelMap.CommonUpdate}</a> </div> </#if> </#if> @@ -193,17 +193,17 @@ function submitForm(form, mode, value) { </div> <div> <label for="giftCardNumber">${uiLabelMap.AccountingNumber}</label> - <input type="text" size="15" class="inputBox" id="giftCardNumber" name="giftCardNumber" value="${(requestParameters.giftCardNumber)?if_exists}" onfocus="$('addGiftCard').checked=true;" /> + <input type="text" size="15" class="inputBox" id="giftCardNumber" name="giftCardNumber" value="${(requestParameters.giftCardNumber)?if_exists}" onfocus="document.getElementById('addGiftCard').checked=true;" /> </div> <#if cart.isPinRequiredForGC(delegator)> <div> <label for="giftCardPin">${uiLabelMap.AccountingPIN}</label> - <input type="text" size="10" class="inputBox" id="giftCardPin" name="giftCardPin" value="${(requestParameters.giftCardPin)?if_exists}" onfocus="$('addGiftCard').checked=true;" /> + <input type="text" size="10" class="inputBox" id="giftCardPin" name="giftCardPin" value="${(requestParameters.giftCardPin)?if_exists}" onfocus="document.getElementById('addGiftCard').checked=true;" /> </div> </#if> <div> <label for="giftCardAmount">${uiLabelMap.AccountingAmount}</label> - <input type="text" size="6" class="inputBox" id="giftCardAmount" name="giftCardAmount" value="${(requestParameters.giftCardAmount)?if_exists}" onfocus="$('addGiftCard').checked=true;" /> + <input type="text" size="6" class="inputBox" id="giftCardAmount" name="giftCardAmount" value="${(requestParameters.giftCardAmount)?if_exists}" onfocus="document.getElementById('addGiftCard').checked=true;" /> </div> </#if> @@ -219,6 +219,6 @@ function submitForm(form, mode, value) { </form> <div> - <a href="javascript:submitForm($('checkoutInfoForm'), 'CS', '');" class="buttontextbig">${uiLabelMap.OrderBacktoShoppingCart}</a> - <a href="javascript:submitForm($('checkoutInfoForm'), 'DN', '');" class="buttontextbig">${uiLabelMap.OrderContinueToFinalOrderReview}</a> + <a href="javascript:submitForm(document.getElementById('checkoutInfoForm'), 'CS', '');" class="buttontextbig">${uiLabelMap.OrderBacktoShoppingCart}</a> + <a href="javascript:submitForm(document.getElementById('checkoutInfoForm'), 'DN', '');" class="buttontextbig">${uiLabelMap.OrderContinueToFinalOrderReview}</a> </div> |
| Free forum by Nabble | Edit this page |
