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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:10:30+00:00 2026-06-18T15:10:30+00:00

If I assign a value to a radio button to use that value in

  • 0

If I assign a “value” to a radio button to use that “value” in my script programming and suppose that value is assigned to a image and the code looks like this

<input type="radio" name="image" value="500"/><img src="1.png">
<input type="radio" name="image" value="500"/><img src="2.png">
<input type="radio" name="image" value="500"/><img src="2.png">

How can I identify which image is which?

I want to identify that user has selected which image, but my constraint is this that the value for all images will be the same.. and since it is a radio so name will be same for all in a same radio group.. what else??

Thanks in advance.

  • 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-18T15:10:31+00:00Added an answer on June 18, 2026 at 3:10 pm

    Give an id to each input item. Then check using document.getElementById("radio1").checked

    <input type="radio" id = "radio1" name="image" value="500"/><img src="1.png">
    <input type="radio" id = "radio2" name="image" value="500"/><img src="2.png">
    <input type="radio" id = "radio3" name="image" value="500"/><img src="2.png">
    
    function check()
    {
       for (var i=1; i <= 3; i++)
       {
         if (document.getElementById("radio" + i).checked)
             alert("image is " + i + ".png");
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have use embedded code to assign the value to label's text property.But the
I have code like this: <html> <SCRIPT language=javascript> function add() { //Create an input
how to assign value directly to kendo data-bind here is the code <script type=text/x-kendo-template
How can i assign value to javasctipt variable from code-behind (C#)? <script type=text/javascript> String.prototype.trim
I have been trying to assign value to an object array that is defined
To assign specific value to 1D array I'm using LINQ like so: int[] nums
When,i try to assign null value to my pointer,it sometimes crashes on that line.
is it possible to assign a value to a ServerVariable(Something) using the code? instead
I used code from http://viralpatel.net/blogs/dynamic-add-textbox-input-button-radio-element-html-javascript/ html-javascript/ .my code is this: <HTML> <HEAD> <TITLE>Dynamically add
I have following code that works - $(function(){ $('#testbutton').click(function(){ var checkedValue = $('[name=someRadioGroup]:radio:checked').val(); $('#result').html('The

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.