Change 2FA Log In Button Text On Click
-
Good Day!
We are trying to change Wordfence’s 2FA overlay form “Log In” button text on click to “Processing…”
Details: https://ibb.co/t3ZpMnJ
We have tried both the PHP and JS code snippets provided below, but none work.
We have also submitted a ticket to Wordfence Support for assistance, but it’s under review and a solution may not be available within 2-3 months.
So, hoping an experienced coder out there can help us. We prefer a PHP Code Snippet ??
Thank you!
———————————
Button HTML Code:
PHP Code Snippet (Option 1):
add_action( 'login_enqueue_scripts', 'login_enqueue_wordfence_js' ); function login_enqueue_wordfence_js() { wp_register_script( 'button-handle-wf', '', array("jquery"), '', true ); wp_enqueue_script( 'button-handle-wf' ); wp_add_inline_script( 'button-handle-wf', '(function($){$("#loginform input#wfls-token-submit").on("click", function() {$(this).val("Processing...");});})(jQuery);'); }
JS Code Snippet (Option 2):
<input onclick="changeText()" type="submit" value="Log In" id="wfls-token-submit"> function changeText(){ let element = document.getElementById("wfls-token-submit"); if (element.value=="Log In") element.value = "Processing..."; else element.value = "Log In"; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Change 2FA Log In Button Text On Click’ is closed to new replies.