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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:17:43+00:00 2026-05-25T18:17:43+00:00

I have two radio buttons what I want is that when I select one

  • 0

I have two radio buttons what I want is that when I select one of them then a drop down list should appear and when other one is marked then drop down list should disappear and instead of it a text message should be displayed.

The code for this part is as follows —

     <head>
     <script type="text/javascript">
            function showhide(r){
            var t=r.form['mode'];
            if (r.value=='none') {
                 t.setAttribute('disabled','disabled');
                 document.getElementById('data').innerHTML="option not supported";         

            }
            else {  
                    t.removeAttribute('disabled');

            }
            t.style.display=r.value;
            }
            </script>
            </head>

            <body>
            <table>
            <tr>
            <td width="400" height="40">Protocol</td>
            <td>
                 <table width="100%" name="table">
                 <tr>
                 <td style="text-align:center">
                 <input type="radio" name="protocol" value="" id="opt1" align="left" checked="checked" onclick="showhide(this)" />opt1
                 </td>

                 <td style="text-align:center">
                 <input type="radio" name="protocol" value="none" id="opt2" align="right" onclick="showhide(this)"/>opt2
                 </td>

                 </tr>
                 </table>

              </td>
              </tr>

              <tr>
              <td width="400" height="40">Mode of Operation</td>
              <td id="data">
                 <select name="mode"  id="mode">
                      <option value="opt1">TCP</option>
                      <option value="opt2">UDP</option>
                 </select>

              </td>
              </tr>
              </table>  
         </bdoy>  

Now the text message (“option not supported”) is displayed once and then it doesn’t disappear when switching between the radio buttons and so drop down list doesn’t appear again.Where am i getting wrong?? If possible make correction in the code.
Please correct me..

  • 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-05-25T18:17:44+00:00Added an answer on May 25, 2026 at 6:17 pm
     <td name="data">
    

    must be

     <td id="data">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two forms, one with a radio button that users must select to
Suppose I have two radio buttons, I want one to be default selected, and
I have two radio buttons and a drop down box as you can see
I have created a radio group which contains two buttons, I can select one
I have those two html radio buttons and textarea. I basically want to enable
I have two radio buttons on my MVC form that I use to hide
I have two radio buttons next to each other, and even though each one
I have two radio buttons each with a unique ID. When one is clicked,
I have a simple form on a website that contains two radio buttons, and
I am a newbie to Android programming. I want two radio buttons that when

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.