Click here to Skip to main content
12,452,056 members (25,947 online)
Rate this:
 
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 13-Oct-12 7:44am
   
Does this help? Radio-Button sample
Hari Krishna Prasad Inakoti 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160826.1 | Last Updated 18 Oct 2012
Copyright © CodeProject, 1999-2016
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