Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript
Hi,
I want to check radiobutton list values using javascript.I have 5 list items in radiobutton list.If we check first item that value is true remaining all are false.and second item we select that is only true remaining all are false .I want output like that .Anybody can give good solution to me.i checked already in google there is so many solutions for 2list items only i tried like that.But it is not working.
 
Thanks & Regards
Hari
Posted 12-Oct-12 23:01pm
Comments
enhzflep at 13-Oct-12 7:44am
   
Does this help? Radio-Button sample
Hari Krishna Prasad Inakoti at 15-Oct-12 0:43am
   
can you give example for server side controls?it is working in html control but it is not working in server side controls

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

<script language="javascript" type="text/javascript">
 
function Validate()
 
{
 
var Gender=document.getElementById("rblGender");
 
var flag=0;
 
for(i=0;i<gender.cells.length;i++)>
 
{
 
if(Gender.cells.firstChild.checked)
 
{
 
flag=1;
 
break;
 
}
 
}
 
if(flag==0)
 
{
 
alert("Please choose gender");
 
return false;
 
}
 
}
 
</script>
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 676
1 OriginalGriff 385
2 CPallini 240
3 PIEBALDconsult 150
4 Magic Wonder 131
0 OriginalGriff 5,835
1 Sergey Alexandrovich Kryukov 5,198
2 CPallini 4,740
3 George Jonsson 3,167
4 Gihan Liyanage 2,470


Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 18 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100