Check input exists
This commit is contained in:
parent
9b2bed5bbc
commit
391af06505
|
@ -365,7 +365,11 @@ class WC_Settings_Accounts extends WC_Settings_Page {
|
||||||
if ( guestCheckout ) {
|
if ( guestCheckout ) {
|
||||||
guestCheckout.addEventListener('change', function() {
|
guestCheckout.addEventListener('change', function() {
|
||||||
const isChecked = this.checked;
|
const isChecked = this.checked;
|
||||||
document.getElementById("woocommerce_enable_delayed_account_creation").disabled = !isChecked;
|
const input = document.getElementById("woocommerce_enable_delayed_account_creation");
|
||||||
|
if ( ! input ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
input.disabled = !isChecked;
|
||||||
});
|
});
|
||||||
guestCheckout.dispatchEvent(new Event('change')); // Initial state
|
guestCheckout.dispatchEvent(new Event('change')); // Initial state
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue