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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:17:25+00:00 2026-06-12T20:17:25+00:00

I have 3 radio buttons : Red, Blue and green When I select one

  • 0

I have 3 radio buttons : Red, Blue and green
When I select one of the three radio buttons, a popup box (alert) should appear and should display the text of the selected radio button (example : Blue). Can anyone please provide the javascript code for the it.
Thank You

Sorry about that, Here’s what I tried regarding the javascript code:

function radioEvent (radio) 
{
var dom = document.getElementById("myForm");
  for (var index = 0; index < dom.radioButton.length;index++) 
  {
    if (dom.radioButton[index].checked) 
    {
      radio = dom.radioButton[index].value;
    }
  }
}


<td rowspan = "2" >
<input type="radio" name= "radioButton" value= "radio1"> Excellent<br>
<input type="radio" name="radioButton"  value="radio2" > Very Good <br>
<input type="radio" name="radioButton"  value="radio3" > Good <br>
<input type="radio" name="radioButton"  value="radio4" > Satisfactory
        </td>

My question is What to do next? I am confused…

  • 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-12T20:17:27+00:00Added an answer on June 12, 2026 at 8:17 pm
    <script type="text/javascript">
    function radioEvent(form) 
    {
     for (var i = 0; i < form.radioButton.length; i++) 
     {
        if (form.radioButton[i].checked)
        {
            alert("You chose " + form.radioButton[i].value + ".")
        }
     }
     }
    </script>
    </head>
    <body>
    <form>
    <input type="radio" name= "radioButton" value= "Excellent"   onclick="radioEvent(this.form);"/> Excellent<br/>
    <input type="radio" name="radioButton"  value="Very Good" onclick="radioEvent(this.form);"/> Very Good <br/>
    <input type="radio" name="radioButton"  value="Good" onclick="radioEvent(this.form);"/> Good <br/>
    <input type="radio" name="radioButton"  value="Satisfactory" onclick="radioEvent(this.form);"/> Satisfactory
    </form>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have 3 radio buttons.what i need to do is that when one radio
I have three radio buttons with same name and different values.When I click the
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 would like to have radio buttons in one radiogroup divided into 2 columns
I have a client that is asking for radio buttons with choices of green,
Okay i have a selection box(drop down menu) and a set of radio buttons.
I have three radio buttons which have the same theme in jquery. If I
I have 2 radio buttons and 2 input fields. I want to associate a
i have four radio buttons , and i want to set a text for

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.