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

  • SEARCH
  • Home
  • 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 8997335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:52:33+00:00 2026-06-15T23:52:33+00:00

— FIDDLE — I’m designing a form that acts like a wizard, walking the

  • 0

— FIDDLE —

I’m designing a form that acts like a wizard, walking the user through each input, and not allowing them to continue until all inputs have been addressed.

I want to show the next row in the table if and only if all inputs in the current row have either been filled out or checked. Rows may contain any number of text inputs, checkboxes, or radio groups.

Here’s my current code:

<table>
    <tr>
        <td><input type="text"></td>

        <td><input type="radio"></td>
    </tr>

    <tr style="display:none">
        <td><input type='radio'></td>

        <td><input type='checkbox'></td>
    </tr>

    <tr style="display:none">
        <td><input type='text'></td>

        <td><input type='text'></td>
    </tr>
</table>​

function refreshCascadingLists() {
    // Get an array of tr's
    // Loop thorugh each and see if it should be shown based on it's predecessors status
    var prevHadUnselected = false;
    $("table tr").next("tr").each(function(curIdx, curEntity) {
        if (prevHadUnselected) {
            $(this).fadeOut();
        } else {
            $(this).fadeIn();
        }

        prevHadUnselected = false;
        $(this).find(":input").each(function(curSelIdx, curSelEntity) {
            if ($(curSelEntity).val() == "" && $(curSelEntity).not(":checked")) 
                prevHadUnselected = true;
        });
    });
}

$(document).ready(function() {
    $(":input").bind('keyup change', function() {
        refreshCascadingLists();
    });
});​

This will show the next row when the user types into the text box in the first row, but they should also have to check the radio button. Furthermore, it’s displaying ALL of the rows in the table, instead of just the next one.

  • 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-15T23:52:33+00:00Added an answer on June 15, 2026 at 11:52 pm

    I would do something like this:

    function refreshCascadingLists($tr) {
        var all_filled = true;
        $tr.find(':input').each(function() {
            if($(this).is('input[type=radio], input[type=checkbox]')) {
                if(!$(this).is(':checked')) {
                    all_filled = false;    
                }
            } else if($(this).val() == '') {
                all_filled = false;
            }
        });
    
        var $next_tr = $tr.next('tr');    
        if(all_filled) {
            if(!$next_tr.is(':visible')) {
                $next_tr.fadeIn(function() {
                    refreshCascadingLists($(this));                    
                });    
            }
        } else {
            $tr.nextAll('tr').hide();
        }
    }
    
    $(document).ready(function() {
        $(":input").bind('keyup change', function() {
            refreshCascadingLists($(this).closest('tr'));
        });
    });​
    

    Most of the function could actually be golfed down quite a bit, but I wrote it like that so you can easily see what it is doing.

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

Sidebar

Related Questions

I'm using a DatePicker ( org.apache.wicket.extensions.yui.calendar.DatePicker — Javadoc ) in a form. The form
I need a function that will clean a strings' special characters. I do NOT
By fixed vector I mean a static list of values, like 1 through 24.
I recently ran against a very interesting site that expresses a very interesting idea
I'm creating a FORM with PHP for an intranet webpage. Another PHP script is
I have set of xml elements like this: <item code=<HTML_CODE> /> For example: <items>
I basically have the classic many to many model. A user, an award, and
&mdash; or &#8212; Is there a difference between these? Is one better-supported than the
How can I get the current Android view when it displays data that has
I have a fairly mundane piece jQuery that toggles a div's visibility when a

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.