Last active
December 7, 2021 12:52
-
-
Save xlplugins/86cc7b286666fe159458fa9ffef16a41 to your computer and use it in GitHub Desktop.
Compatability plugin with DIGITS: Merge Phone Number Addon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class WFACP_Do_Not_Fill_username { | |
public function __construct() { | |
add_action( 'wfacp_internal_css',[$this,'add_css'] ); | |
} | |
public function add_css(){ | |
?> | |
<script> | |
window.addEventListener('load', function () { | |
(function ($) { | |
function pre_filled_value_new() { | |
$(document.body).on('focusout change', ".wfacp-form-control", function () { | |
var val= $("#wfacp_checkout_form #username").val(); | |
localStorage.setItem("lastname", val); | |
}); | |
} | |
function populate_fields_value_new() { | |
var test = localStorage.getItem("lastname"); | |
$("#wfacp_checkout_form #username").val(test); | |
}; | |
setTimeout(function(){ | |
pre_filled_value_new(); | |
populate_fields_value_new(); | |
console.log("tester"); | |
},100); | |
})(jQuery); | |
}); | |
</script> | |
<?php | |
} | |
} | |
new WFACP_Do_Not_Fill_username(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment