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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:46:06+00:00 2026-06-10T03:46:06+00:00

I know you can’t give a same id to elements in one page. But

  • 0

I know you can’t give a same id to elements in one page. But i have a list which PHP generates with a SELECT * statemnt, this list shows all the rows in database in a HTML table
each row of data has a radiobox next to it which its value is the id of that row in mysql. what I am trying to do here is when you check the Radio for that row and run the Func, JavaScript gets the Value which is the id number so I can delete that row

Something like this: but again I can’t give all the radio the same id

var age = document.getElementById('radio').value;
    var queryString = "?id=" + radio;
    ajaxRequest.open("GET", "coderemove.php" + queryString, true);
    ajaxRequest.send(null); 

When I run this nothing happens, obviously

  • 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-10T03:46:08+00:00Added an answer on June 10, 2026 at 3:46 am

    You could use the pure JavaScript approach – imagine the PHP code outputs this:

    Thing Number 1 <input type="radio" name="myRadioId" value="thingy1" />
    Thing Number 2 <input type="radio" name="myRadioId" value="thingy2" />
    

    Then our JavaScript code could be:

    function getRadioValue(radioName){
        // Get all inputs on the page.
        var inputs = document.getElementsByTagName('input');
    
        for (var i = 0; i < inputs.length; i++) {
            // Check it is a radio of the correct name and is checked.
            if (inputs[i].type === 'radio' &&
                inputs[i].name === radioName &&
                inputs[i].checked) {
    
                // We have the checked radio - return its value.
                return inputs[i].value;
            }
        }
        return null;
    }
    
    var queryString = "?id=" + getRadioValue('myRadioId');
    // Do stuff here
    

    But if we use jQuery – then it becomes much simpler:

    var queryString = "?id=" + $("input:radio[name=myRadioId]").val();
    

    If you don’t know JavaScript, and you are looking to program web-pages using it, I encourage you to spend an hour learning the basics of jQuery. It will save you some hassle : )

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

Sidebar

Related Questions

I have a query that I know can be done using a subselect, but
I know you can share control easily with master page. But what if I
I want to know can we have a JPanel with a Layout other than
You can know if the event stack is empty calling the gtk.events_pending() method, but
I know you can not set a key value dynamically, but what about the
I know you can invite friends to your Facebook Fan Page via Admin Panel
This is probably a basic LINQ question. I have need to select one object
I have some following requirements, I don't know can we do this in iPhone
I know can use string.find() to find a substring in a string. But what
i just want to know can we pass nsdata or array datatype from one

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.