Error on the New Hosted Login Page does Not Disappear when a New Value is Typed

Overview

The error on the hosted new login page that appears after entering an invalid email does not disappear when a new, valid value is typed. This article explains how to clear this error once a valid email address is entered.


 

.

Applies To

  • Hosted Login Page
  • Error

Solution

The following custom page template can be used to hide the error message when the user types a new input. The template can bu updated with the management APIThe custom template update only works with the custom login domain.

<!DOCTYPE html><html>
  <head>
    {%- auth0:head -%}
    <script>
        window.onload = function() {
          if (document.getElementById('email')) {
            document.getElementById('email').addEventListener('input',function(e){
              if (document.getElementById("error-element-email")) {
                document.getElementById("error-element-email").style.display = "none"
              }
            });
          }

          if (document.getElementById('username')) {
            document.getElementById('username').addEventListener('input',function(e){
              if (document.getElementById("error-element-username")) {
                document.getElementById("error-element-username").style.display = "none"
              }            
            });
          }

          if (document.getElementById('password')) {
            document.getElementById('password').addEventListener('input',function(e){
              if (document.getElementById("error-element-password")) {
                document.getElementById("error-element-password").style.display = "none"
              }
              
            });
          }
        };
    </script>
  </head>
  <body>
    {%- auth0:widget -%}
  </body></html>

 

Recommended content

No recommended content found...