How to apply groupname to HTML radio buttons in asp.net?


Problem:

Can anyone please tell about how to apply group name to html (input) radio button controls so that i can select any one of the available radio buttons?

I have input radios in a table. Each row contains two radios as follows. I want to select one from each row. But i am able to select only one radio button amongst all radio buttons present on all rows.

<input name="radiobutton" type="radio" value="radiobutton" />Option1
<input name="radiobutton" type="radio" value="radiobutton" />Option2

What change i have to make to select one radio button on each row?

Thanks, ~kaps


Solution:

As far as I know, radiobuttons in HTML do not have group names. Their HTML "name" attribute is the group name.

It is important to verify that each radiobutton has a unique "value" attribute. Otherwise there is no way to tell which of the duplicate values was selected:

<input name="radiobutton" type="radio" value="radiobutton1" />Option1 
<input name="radiobutton" type="radio" value="radiobutton2" />Option2 

Recent Tips

  1. What is the most stable modal dialog implementation across browsers to use from javascript for a web app?
  2. Move, Remove, and Replace information from Google Sheets with new entries using Google Script
  3. How can I get rid of jerkiness in WinForms scrolling animation?
  4. Update MySQL table column from another table entities
  5. Shoot fireball once in unity C#
  6. Adding a table of contents to a Microsoft Word Document using vbs
  7. Change locale in android app (onto Hindi)
  8. How do I stop selenium automation if 20% or 1st 20 test cases test methods are failed?
  9. Sharepoint with silverlight app
  10. What's the best way to write robots.txt for github pages using multiple repos?
  11. Biopython: Cant use .count() for biopython
  12. How can I find out the token balance of an address?
  13. ref value is undefined in vue (modal, textarea, $refs)
  14. Azure - HDInsight Hbase Data Insertion Failed
  15. SignalR overwriting OnConnected(), OnDisconnected()
  16. DatePickerDialog displays with two borders
  17. "type 'double' is not a subtype of type 'int' in type cast" error in flutter. What should i do?
  18. hiding the autocomplete list when user click outside the textbox is not working as expected
  19. JSF IceFaces basic problem with redisplaying input value
  20. How to validate material ui TextField in reactjs?
  21. Go and MongoDB connection won't work with panic log "no reachable server"
  22. WordPress Posts Pagination Not Working
  23. F# sprintf won't print in interactive console
  24. Spring Integration get FTP files recursively with outbound-gateway
  25. Jade mixins not getting working from external file
  26. Can not access defined exports from the webpack bundle?
  27. Completely new to Node.js - API Programming
  28. Formatting Compare-Object Ouput
  29. Add dynamically added textbox value from User Control to main form
  30. Create a ByteBuf in Netty 4.0