•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 456,234 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,772 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 3599 | Replies: 2 | Solved
![]() |
hii every one,
i have an application containing data list.
datalist contains radio button as item template.i want only one radio button to be checked ie when the user clicks on one checkbox the other checkboxes should be unchecked.i have used groupname ,but no use .can any one give the solution to this problem.
i have an application containing data list.
datalist contains radio button as item template.i want only one radio button to be checked ie when the user clicks on one checkbox the other checkboxes should be unchecked.i have used groupname ,but no use .can any one give the solution to this problem.
•
•
Join Date: Sep 2007
Posts: 1,058
Reputation:
Rep Power: 4
Solved Threads: 61
well, you can use checkboxlist but it doesn't work like radio buttons do. The user will be able to select multiple ones if you choose checkboxes instead of radio buttons. But if you decide to do checkboxes, use javascript to uncheck the other boxes in your group.
I haven't tested it, but it should work. What it does is set all the checkboxes to unchecked, then checks the corresponding checkbox found by its name. Make sure that all your checkboxes are one ID (that are affected anyway), and then have each one a different name.
<script type="text/javascript">
function selectChkBox(field,checkit)
{
for (i = 0; i < field.length; i++) {
field[i].checked = false;
}
checkit.checked = true;
}
</script>
then call it with an OnClick event like below:
<label><input type="checkbox" id="chkSelection" name="checkbox3" value="3" onclick="javascript:selectChkBox(document.formname.chkSelection,this.name)" />Checkbox 3</label> hii,
i have found the solution to this problem.The problem and solution to this issue is very well addressed in the following two articles.
hope this helps others,
http://aspnet.4guysfromrolla.com/articles/122602-1.aspx
http://www.codeproject.com/aspnet/Ho...sp?msg=1188105
i have found the solution to this problem.The problem and solution to this issue is very well addressed in the following two articles.
hope this helps others,
http://aspnet.4guysfromrolla.com/articles/122602-1.aspx
http://www.codeproject.com/aspnet/Ho...sp?msg=1188105
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Literal vs Repeater/Datalist for 2 values (ASP.NET)
- Datalist Repeater Help (ASP.NET)
- Edit item event handler issue (ASP.NET)
- Why javascript does not work on firefox? (JavaScript / DHTML / AJAX)
- Display formatted dataList based on events.. (ASP.NET)
- Using the Datalist Control as a Menu (ASP.NET)
- hide checkbox when field value is null (ASP.NET)
- hide checkbox in grid appropriately (ASP.NET)
- Adding a checkbox column dynamically (C#)
Other Threads in the ASP.NET Forum
- Previous Thread: NEED HELP! I want to learn ASP.NET
- Next Thread: Passing value of string from one button click event to another



Linear Mode