Congratulations to all monthly winners of May 2013 !!! They have won INR 2900 cash and INR 27497 worth prize.
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 5930 |  Welcome, Guest!   Register  Login
 Home > Code Snippets > C# > Radio Button functionality in a Grid/Repeater/DataList controls ...
Lakhangarg

Radio Button functionality in a Grid/Repeater/DataList controls

 Code Snippet posted by: Lakhangarg | Posted on: 9/1/2009 | Category: C# Codes | Views: 2060 | Status: [Member] [Moderator] | Alert Moderator   
Ads

To select one option in a Grid/Repeater/DataList controls
Pass the Container Control's ID and Radio Button ID mentioned in grid.

function SelectOneOption(ctlTargetControl,ctlID)

{
var TargetControl = document.getElementById(ctlTargetControl);
var checkCount=0;
var Inputs = TargetControl.getElementsByTagName("input");
for(var n = 0; n < Inputs.length; ++n)
{
if(Inputs[n].type == 'radio' && Inputs[n].id == ctlID)
{
if(Inputs[n].checked)
checkCount=checkCount+1;

if(checkCount>1)
retrun false;
}
}
return true;
}

Found interesting? Add this to:


>> Write Response - Respond to this post and get points

More codes snippets

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 6/19/2013 1:58:00 PM