Return to Snippet

Revision: 57669
at June 9, 2012 03:54 by cpres


Updated Code
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";
                }
            }
        }
    },

Revision: 57668
at June 5, 2012 04:05 by cpres


Initial Code
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].value == "" || overrides[j].value == "--") && overrides[j].id.indexOf("telephone") >= 0) {
                overrides[j].value = "0000000000";
            }
        }
    },

Initial URL

                                

Initial Description
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

Initial Title
Magento Customer Saving Blocked by Phone #

Initial Tags
jquery, magento

Initial Language
jQuery