Hi Brajesh,
I was trying to improve user experience when trying to login with the branded login plugin by providing user feedback after clicking the login button but I dont know why this script is not working.
The (Loading…) text is not being displayed after clicking the login button
function klein_login_form_js() { if ( !is_user_logged_in() && (is_page(28880) || is_page(33424)) ) { // Only load the script on specific pages with the login shortcode ?> <script id="klein-login-form-script" type="text/javascript"> document.addEventListener("DOMContentLoaded", function() { var form = document.getElementById("loginform"); if (form) { form.addEventListener("submit", function() { var submitBtn = document.getElementById("bl-login-submit"); if (submitBtn) { submitBtn.disabled = true; submitBtn.value = "Loading..."; submitBtn.setAttribute("disabled", "disabled"); } }); } }); </script> <?php } } add_action( 'wp_footer', 'klein_login_form_js' );
Thanks
Hi Tosin,
Please check page source to confirm that the script is added to the page.
if it is added, you should remove the callback attachment to DOMContentLoaded event and call it directly as it is in the footer.Those 2 seems like obvious reasons. After that we can investigate the id etc if needed.
Regards
BrajeshThank you Tosin.
That’s good to know!Regards
Brajesh
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic.
This topic is: resolved