/ Published in: jQuery
Annoyed by Please enter a valid phone number. For example (123) 456-7890 or 123-456-7890. in admin? Here's the trick.
Copy over your default/default/template/customer/tab/addresses.phtml to your default/your-template/template/customer/tab/address.phtml
Copy over your default/default/template/customer/tab/addresses.phtml to your default/your-template/template/customer/tab/address.phtml
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
addressesModel.prototype = { initialize : function() { /*** in the initialization of the addressModel at the end right after bindCountryRegion I put the initilization for the overrideTelephone script I made. ***/ this.bindCountryRegionRelation(); this.overrideTelephone(); /*** Put this function somewhere in the mix where it suits your fancy ****/ // Used to override annoying telephone alerts while saving a customer in admin overrideTelephone: function() { var overrides = $(this.formContainer).getElementsByClassName('required-entry'); for(var j in overrides) { if (overrides[j].id.indexOf("telephone") >= 0) { var phone = overrides[j].value.replace(/\D/g, ''); if (phone != overrides[j].value) { overrides[j].value = phone; } if ( overrides[j].value == "") { overrides[j].value = "0000000000"; } } } },