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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:01:54+00:00 2026-05-15T02:01:54+00:00

<form id=Numbers1 <table id=numbers> <tr> <th> prvi_br </th> <th> drugi_br </th> <th> treci_br </th>

  • 0
<form id="Numbers1"
<table id="numbers">
    <tr>
        <th>
            prvi_br
        </th>
        <th>
            drugi_br
        </th>
        <th>
            treci_br
        </th>
    </tr>
<% int rb = 1; %>
<% foreach (var item in Model) { %>

    <tr>

        <td>
        <%= Html.Encode(item.prvi_br) %>
        <input type="radio" name="<%= Html.Encode(rb) %>"  value="<%= Html.Encode(rb) %>" id='<%= Html.Encode(item.prvi_br) %>'/>

        </td>
        <td>
        <%= Html.Encode(item.drugi_br) %>
        <input type="radio" name="<%= Html.Encode(rb) %>" value="<%= Html.Encode(rb) %>" id='<%= Html.Encode(item.drugi_br) %>'/>

        </td>
        <td>
        <%= Html.Encode(item.treci_br) %>
        <input type="radio" name="<%= Html.Encode(rb) %>" value="<%= Html.Encode(rb) %>" id='<%= Html.Encode(item.treci_br) %>'/>

        </td>
        <% rb=rb+1; %>
    </tr>  
<% } %>

</table>
        <p>
            <input type="submit" value="Save" />
        </p>
</form>

With this script I get some info of selected radio:

<script type="text/javascript">
$(document).ready(function() {

    var thevalue1;
    var thevalue2;

    $("#Numbers1").submit(function() {
    $("input:radio:checked").each(function() {
            thevalue1 = $("input:radio:checked").attr('id');
            thevalue2 = $("input:radio:checked").val();
            alert(thevalue1 + thevalue2); 
        });          
    });
});
</script>

If I have more rows this alert every time prints the information of first selected radio, why???

  • 1 1 Answer
  • 4 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-15T02:01:55+00:00Added an answer on May 15, 2026 at 2:01 am

    Because for every checked radio button, you call $("input:radio:checked").attr('id') which returns the id attribute of the first thing that matches "input:radio:checked".

    $("input:radio:checked").each(function() {
            Element = $(this);
            var thevalue1 = Element.attr('id');
            var thevalue2 = Element.val();
            alert(thevalue1 + thevalue2); 
        });          
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using a nested model form to edit all phone numbers of a
Hi I want to validate a form input so it only takes the numbers
<form><input type=file name=first onchange=jsFunction(2);> <input type=file name=second onchange=jsFunction(3);</form> Possible to pass just numbers to
I have a table of input fields. The form will be used by inexperienced
I've got a form with a table with originally 1 row of input fields.
I was wondering how I could input a value into a form with html.
I need to summarize numbers like CREATE TABLE #t(num int); INSERT #t SELECT 10001
I have the following code that generates my form on my html page <input
My html code to take two user chosen input numbers and do calculation. Trouble
I have a table which uses a large number of form fields (the HTML

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.