RajatShukla / getpaid

Automatically exported from code.google.com/p/getpaid
0 stars 0 forks source link

Mailing address same as billing address should blank all mailing address fields #210

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Fill some Mailing address fields
2. Click 'same as billing address'

What is the expected output? What do you see instead?
I expected mailing address fields to be blanked, to be sure my mailing
address will be the same as the Billing Address. Instead, values are kept.

Original issue reported on code.google.com by walteralini on 5 Sep 2008 at 6:32

GoogleCodeExporter commented 9 years ago

Original comment by cjj.ifpe...@gmail.com on 5 Sep 2008 at 10:02

GoogleCodeExporter commented 9 years ago
I change the script checkout-process.js into
jQuery(function($) {

    /* ship_same_billing enables/disables all inputs of #mailing-address */
    $("#form\\.ship_same_billing").bind('click', function(e) {

        var $disable = '';
        if ($(this).attr('checked')) {
            $disable = 'disabled';

        }
        $("#mailing-address input").not(document.getElementById("save_to_addressbook")).attr("disabled", $disable);
        $("#mailing-address input").not(document.getElementById("save_to_addressbook")).attr("value", "");
        $("#mailing-address select").attr("disabled", $disable);
        $(this).removeAttr('disabled');
    });

});
the values are now blanked and the button "Save to Adress book" is no more 
disabled when the billing and mailing addresses are the same

Original comment by danielle...@gmail.com on 26 Dec 2010 at 3:21

GoogleCodeExporter commented 9 years ago
in fact we have to be more carefull for the inputs ( one is hidden...) and use
        $("#mailing-address input").not(document.getElementById("save_to_addressbook")).not(document.getElementById("addressbook_entry_name")).attr("disabled", $disable);
instead of 
$("#mailing-address 
input").not(document.getElementById("save_to_addressbook")).attr("disabled", 
$disable);

Original comment by danielle...@gmail.com on 27 Dec 2010 at 1:53

GoogleCodeExporter commented 9 years ago
really more carefull, I said :)
to not blank the value of the load_from_addressbook we need 
$("#mailing-address 
input").not(document.getElementById("save_to_addressbook")).not(document.getElem
entById("load_from_addressbook")).attr("value", "");

Original comment by danielle...@gmail.com on 27 Dec 2010 at 3:04