Click here to Skip to main content
14,381,948 members
Rate this:
Please Sign up or sign in to vote.
See more:
I have jquery tabs login and sign up i need when the registration page has errors to trigger the registration page to open but the default first page is login
<div class="auth-buttons" >
                <a class="btn" id="btn-login">Login</a>
                <a class="btn" id="btn-register">Register</a>

<div id="lgn" class="btns">
        <form method="POST" action="{{ route('login')}}" autocomplete="off">

<div id="reg" class="btns">
 <form method="POST" action="{{ route('register')}}" autocomplete="off">
<pre lang="Javascript"><script>



I have tried this script but its not working, when register has errors it displays the errors but it goes back to login first

What I have tried:


    $(function() {
    let hasErrors = document.getElementsByClassName('errorClass').length > 0;


Updated 2-Nov-19 2:43am
Richard Deeming 1-Nov-19 14:27pm
Why are you clicking the button when there are validation errors? Shouldn't you be clicking the button when there aren't any validation errors instead?

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100