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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:55:02+00:00 2026-06-03T08:55:02+00:00

I have a table with an input field in a table row and an

  • 0

I have a table with an input field in a table row and an option boxe and I want, that the <tr> with the input field only appears when a specific value in the option box are selected. So far I have the following coding, it hides my <tr> with the input field, but never displays it again.

 $script = <<< EOF
<script type='text/javascript'>
    jQuery(document).ready(function($) {
        $('#row_sports').hide(); //works


         if($('#sel_rugby').is(':selected') || $('#sel_climbing').is(':selected')){
             $('#row_sports').show();

         }else{
            $('#row_sports').hide();
         }

    });
</script>
EOF;
        echo $script;


    echo '<table border="1">';
    echo '  <tr>';
    echo '      <td>';
    echo '          <select name="sports">';
    echo '              <option>Baseball</option>';
    echo '              <option id="sel_rugby">Rugby</option>';
    echo '              <option>Soccer</option>';
    echo '              <option>Sailing</option>';
    echo '              <option id="sel_climbing">Climbing</option>';
    echo '          </select>';
    echo '      </td>';
    echo '  </tr>';
    echo '  <tr id="row_sports">';
    echo '      <td>';
    echo '          <input name="sports_cl_rg" />';
    echo '      </td>';
    echo '  </tr>';
    echo '</table>';

BR & thx,
mybecks

  • 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-03T08:55:04+00:00Added an answer on June 3, 2026 at 8:55 am
    <script type='text/javascript'>
        jQuery(document).ready(function($) {
            $('#row_sports').hide(); //works
    
            $('select').change(function() {
             if($('#sel_rugby').is(':selected') || $('#sel_climbing').is(':selected')){
                 $('#row_sports').show();
    
             }else{
                $('#row_sports').hide();
             }
            });
    
        });
    </script>
    

    use change function too.. here it works

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

Sidebar

Related Questions

I have a html element (like select box input field) in a table. Now
In my GWT program I have a table that has a selected row. I'd
I have the following HTML: <table> <tr class=row> <td class=field> <input type=text /> </td>
TABLE bcompany companyID | cName | ... I have the input field, where user
There is one table that have fields included the add row button. I am
I have a table of input fields where I want to 1)change the first
I have a table which has one row and only one cell will be
I have a table that contains multiple rows. Each row contains 5 columns (or
I have the following html: <table> <tr> <td> <input type=button id=btnAdd value=Add /> <input
I have an HTML table with input elements that I am using for batch

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.