Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Catch event when checking login

Catch event when checking login

Baam
Shopify Partner
6 0 0

hi guy,  I have a form below that selects users to log in; Currently, when the user successfully logs in, they will move to another page, but I want when the user logs in successfully, the #ogin-successful div will appear, and if it fails, it will display arlert: login failed. Does anyone know if they can help me? Thank you!

<form method="post" action="/account/login" id="customer_login" accept-charset="UTF-8" data-login-with-shop-sign-in="true" novalidate="novalidate"><input type="hidden" name="form_type" value="customer_login"><input type="hidden" name="utf8" value="✓">
    <input type="hidden" name="form_type" value="customer_login">
    <input type="hidden" name="utf8" value="✓">
    <input type="hidden" name="return_to" value="https://onmanedev.myshopify.com/pages/demo">  
    <div class="field">
        <input type="email" name="customer[email]" id="CustomerEmail" autocomplete="email" autocorrect="off" autocapitalize="off" placeholder="Email">
        <label for="CustomerEmail">
            Email
        </label>
    </div>
    <div class="field">
        <input type="password" value="" name="customer[password]" id="CustomerPassword" autocomplete="current-password" placeholder="Password">
        <label for="CustomerPassword">
            Password
        </label>
    </div>
    <div class="field crate-or-forgot">
        <a href="#popupRecover" id="btnRecover">  Forgot your password? </a> 
        <span>or</span>
        <a href="#popupRegister" id="btnRegister"> Create account</a>
    </div>  
    <div class="field submit-filed">
        <button> Sign in</button>
    </div>
</form> 
<div id="login-successful" class="login-successful" style="display:none;">
    <button>Sign in 1</button>
    <button>Sign in 2</button>
</div>

 

Replies 0 (0)