Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8882493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:35:36+00:00 2026-06-14T20:35:36+00:00

An example use case would be a registration form that was split into several

  • 0

An example use case would be a registration form that was split into several steps. I.e. there are three steps:

  • Container 1 is visible
  • Container 2 is hidden
  • Container 3 is hidden

User clicks next button:

  • Container 1 is hidden
  • Container 2 is visible
  • Container 3 is hidden

User clicks next button:

  • Container 1 is hidden
  • Container 2 is hidden
  • Container 3 is visible

User clicks previous button:

  • Container 1 is hidden
  • Container 2 is visible
  • Container 3 is hidden

and so on. This is what I tried:

$('#btn-next-step').live('click', function(){
    $('.form-step').each(function(){
        if($(this).is(':visible')){
            $(this).hide();
        }else{
            $(this).show();
            return false;
        }
    });
});

HTML:

<form>
    <div class="container-fluid form-step form-step1">
        step1
    </div>
    <div class="container-fluid form-step form-step2">
        step2
    </div>
    <div class="container-fluid form-step form-step3">
        step3   
    </div>
</form>

Here is my fiddle: http://jsfiddle.net/feFcu/

Can you help me with the logic. Any ideas how to realize this kind of behaviour?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:35:37+00:00Added an answer on June 14, 2026 at 8:35 pm

    First, store the visible one in a variable. Then hide all of them, and use .next('.form-step') to find the one that follows the previously visible one, and .show() it.

    $('#step').on('click', function(){
        // Find the visible one and store in a variable
        var showing = $('.form-step:visible');
        // Hide all of them (including the currently visible one)
        $('.form-step').hide();
        // Find the next one with .next() and make it visible
        showing.next('.form-step').show();            
     });​
    

    Here is the updated jsfiddle example…

    Note that I have replaced .live() with .on(), since .live() is now deprecated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this use case that is very similar to the robot-legs example of
I am looking for an ideal example of a Use Case diagram which would
By dynamic data rating I mean a time-based recommendation system. One example use case
For example if i use $id= $_GET['id']; and then i use that $id as
I'll use an example to explain what behaviour I would like to achieve. If
Many sites with registration that ask email confirmation and sites use tokens in their
Use Case: Would like to use IReport to Label item sold in my shop.
Use case example: Client A comes to request sales information, enters their zip code
The use case is that I have a remote (read slow) database from which
An example use case of font awesome is like this (as taken from their

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.