• The orange “Qualified Client Login” button on the top-right is a slide panel that opens with a login form. When you enter the right info it closes and redirects to the access page, but if you enter the wrong info the panel closes and the error message is only veiwable if and when you reopen the panel.

    How do you make the panel stay open if the user enters the wrong info? So they can see the error message!?

    https://www.tipsprevention.com/contact/

    js for the slide panel:

     <script type="text/javascript">
    	$(document).ready(function(){
    
    	$(".btn-slide").click(function(){
    	$("#slide-panel").slideToggle("slow");
    	});
    		 
    	});
    	</script>

    Login form for Membership Pro plugin:

    
    <div class="logout ">
               <?php echo do_shortcode('[ihc-hide-content ihc_mb_type="show" ihc_mb_who="unreg" ihc_mb_template="3" ][/ihc-hide-content]'); ?>
               </div>
Viewing 2 replies - 1 through 2 (of 2 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I see the URL contains a way to identify if the page has an error in the form – which is great. So you can use that ‘?ihc_login_fail=true’ bit in your code:

    
    var errorIdentifier = '?ihc_login_fail=true';
    
    // If the URL has the error
    if (window.location.href.indexOf(errorIdentifier ) > -1) {
        $("#slide-panel").slideToggle(0);
    }
    
    Thread Starter angeladesign

    (@angeladesign)

    Thank you this solved the issue!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to keep javascript slide panel open when form has errors after clicking?’ is closed to new replies.