Click here to Skip to main content
15,884,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
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
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

<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>
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900