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 8863233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:55:33+00:00 2026-06-14T15:55:33+00:00

I have a table with radio buttons, on the first column, options are: ‘—‘

  • 0

I have a table with radio buttons, on the first column, options are:

  • ‘—‘
  • ‘No Stock’
  • ‘With Stock’

On the second column, options are:

  • ‘—‘
  • ‘No Stock’
  • ‘Low’
  • ‘Medium’
  • ‘High’

Now what I want to do is, when the user clicked ‘No Stock’ on the first column, the ‘No Stock’ radio option on the second column should be checked.

Here’s what I’m doing:

HTML:

<table border='1'>

    <tr>
        <td class="valign_top" style="text-align:left;">
            <div class="radio_field">
                <input type="radio" class="stock_avail" id="93_stock_avail_0" name="93_stock_avail" value="0" checked=""> ---
            </div>

            <div class="radio_field">
                <input type="radio" class="stock_avail" id="93_stock_avail_No" name="93_stock_avail" value="No"> No Stock
            </div>

            <div class="radio_field">
                <input type="radio" class="stock_avail" id="93_stock_avail_Yes" name="93_stock_avail" value="Yes"> With Stock
            </div>
        </td>

        <td class="sa_sw_td valign_top" style="text-align:left;">                    
            <div class="radio_field">
                <input type="radio" class="sa_sw" name="93_sa_sw" id="93_sa_sw_0" value="0" checked=""> ---
            </div>

            <div class="radio_field">
                <input type="radio" class="sa_sw" name="93_sa_sw" id="93_sa_sw_1" value="1"> No Stock
            </div>

            <div class="radio_field">
                <input type="radio" class="sa_sw" name="93_sa_sw" id="93_sa_sw_2" value="2"> Low
            </div>

            <div class="radio_field">
                <input type="radio" class="sa_sw" name="93_sa_sw" id="93_sa_sw_3" value="3"> Medium
            </div>

            <div class="radio_field">
                <input type="radio" class="sa_sw" name="93_sa_sw" id="93_sa_sw_4" value="4"> High
            </div>
        </td>
    </tr>


    <tr>
        <td class="valign_top" style="text-align:left;">
            <div class="radio_field">
                <input type="radio" class="stock_avail" id="94_stock_avail_0" name="94_stock_avail" value="0" checked=""> ---
            </div>

            <div class="radio_field">
                <input type="radio" class="stock_avail" id="94_stock_avail_No" name="94_stock_avail" value="No"> No Stock
            </div>

            <div class="radio_field">
                <input type="radio" class="stock_avail" id="94_stock_avail_Yes" name="94_stock_avail" value="Yes"> With Stock
            </div>
        </td>

        <td class="sa_sw_td valign_top" style="text-align:left;">                    
            <div class="radio_field">
                <input type="radio" class="sa_sw" name="94_sa_sw" id="94_sa_sw_0" value="0" checked=""> ---
            </div>

            <div class="radio_field">
                <input type="radio" class="sa_sw" name="94_sa_sw" id="94_sa_sw_1" value="1"> No Stock
            </div>

            <div class="radio_field">
                <input type="radio" class="sa_sw" name="94_sa_sw" id="94_sa_sw_2" value="2"> Low
            </div>

            <div class="radio_field">
                <input type="radio" class="sa_sw" name="94_sa_sw" id="94_sa_sw_3" value="3"> Medium
            </div>

            <div class="radio_field">
                <input type="radio" class="sa_sw" name="94_sa_sw" id="94_sa_sw_4" value="4"> High
            </div>
        </td>
    </tr>

</table>​

JavaScript:

$(document).ready(function(){
    $('.stock_avail').click(function(){

        var value = $(this).val();
        console.log("value: " + value);

        if(value=='No'){
            $(this).next('td').find('radio').val(2);
        }

    });
});​

This might help: http://jsfiddle.net/E6mhM/.

Any ideas how to do that? TIA!!!

  • 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-14T15:55:34+00:00Added an answer on June 14, 2026 at 3:55 pm
    $(document).ready(function(){
        $('.stock_avail').click(function(){
    
            var value = $(this).val();
            console.log("value: " + value);
    
            if(value=='No'){
                $(this).closest("td").next().find("input[value=1]").attr("checked",true);
            }
    
        });
    });​
    

    Demo: http://jsfiddle.net/E6mhM/4/

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

Sidebar

Related Questions

I have a table <table> <tr><td><input radio name=R1 onClick=getOtherColumnData()>first</td><td>TR1-TD2</td><td>TR1-TD3</td><td>TR1-TD4</td></tr> <tr><td><input radio name=R1 onClick=getOtherColumnData()>Second</td><td>TR2-TD2</td><td>TR2-TD3</td><td>TR2-TD4</td></tr> <tr><td><input
i have a table where the first column is a radio button and the
I have a table with two radio buttons for each row, these buttons are
I have a table (in a form) populated with radio buttons (with a button
I have a table of radio buttons that have an ID value that contains
I have this table containing 3 radio buttons, I want to find out whether
I have a table full of radio buttons. Each one has a name and
I have multiple table rows that has a set of radio buttons on each
I have two tables. I want to show one table when the first radio
i have a table which contains a bunch of dynamically created radio button lists,

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.