$(function () { $("input[name='formComponentsMap['order'].firstName']").attr('disabled', 'disabled'); $("input[name='formComponentsMap['order'].lastName']").attr('disabled', 'disabled'); $("input[name='formComponentsMap['order'].addressLine1']").attr('disabled', 'disabled'); $("input[name='formComponentsMap['order'].addressLine2']").attr('disabled', 'disabled'); $("input[name='formComponentsMap['order'].city']").attr('disabled', 'disabled'); setTimeout(function (){ $("[name='formComponentsMap['order'].stateId']").attr('disabled', 'disabled'); }, 5); $("input[name='formComponentsMap['order'].postalCode']").attr('disabled', 'disabled'); $("[name='formComponentsMap['order'].countryId']").attr('disabled', 'disabled'); $("[name='formComponentsMap['order'].phoneNumber']").attr('disabled', 'disabled'); $("[name='formComponentsMap['order'].faxNumber']").attr('disabled', 'disabled'); $("[name='formComponentsMap['order'].emailAddress']").attr('disabled', 'disabled'); $("[name='formComponentsMap['order'].confirmEmailAddress']").attr('disabled', 'disabled'); $("td:eq(5)").append('Check to edit billing information'); $('#addressStatus').click(function () { if ($('#addressStatus').is(':checked')) { $("input[name='formComponentsMap['order'].firstName']").removeAttr('disabled'); $("input[name='formComponentsMap['order'].lastName']").removeAttr('disabled'); $("input[name='formComponentsMap['order'].addressLine1']").removeAttr('disabled'); $("input[name='formComponentsMap['order'].addressLine2']").removeAttr('disabled'); $("input[name='formComponentsMap['order'].city']").removeAttr('disabled'); $("[name='formComponentsMap['order'].stateId']").removeAttr('disabled'); $("input[name='formComponentsMap['order'].postalCode']").removeAttr('disabled'); $("input[name='formComponentsMap['order'].phoneNumber']").removeAttr('disabled'); $("[name='formComponentsMap['order'].countryId']").removeAttr('disabled'); $("[name='formComponentsMap['order'].faxNumber']").removeAttr('disabled'); $("[name='formComponentsMap['order'].emailAddress']").removeAttr('disabled'); $("[name='formComponentsMap['order'].confirmEmailAddress']").removeAttr('disabled'); } else { $("input[name='formComponentsMap['order'].firstName']").attr('disabled', 'disabled'); $("input[name='formComponentsMap['order'].lastName']").attr('disabled', 'disabled'); $("input[name='formComponentsMap['order'].addressLine1']").attr('disabled', 'disabled'); $("input[name='formComponentsMap['order'].addressLine2']").attr('disabled', 'disabled'); $("input[name='formComponentsMap['order'].city']").attr('disabled', 'disabled'); $("[name='formComponentsMap['order'].stateId']").attr('disabled', 'disabled'); $("input[name='formComponentsMap['order'].postalCode']").attr('disabled', 'disabled'); $("input[name='formComponentsMap['order'].phoneNumber']").attr('disabled', 'disabled'); $("[name='formComponentsMap['order'].countryId']").attr('disabled', 'disabled'); $("[name='formComponentsMap['order'].faxNumber']").attr('disabled', 'disabled'); $("[name='formComponentsMap['order'].emailAddress']").attr('disabled', 'disabled'); $("[name='formComponentsMap['order'].confirmEmailAddress']").attr('disabled', 'disabled'); } }); });