Click here to Skip to main content
15,908,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
visit here[^]

if you clicked radiobuttonlist itemss counter count

left on the screen how can ı do like that ?
Updated 20-Feb-12 4:46am
E.F. Nijboer 20-Feb-12 9:41am    
You can just check out the source of that page to see how its done.

for your radio buttons, set their onclick property to countUp(). Then use a javascript function to update a counter and show its value in an element. like this :

<input type="radio" name="a" value="a" checked=""  önclick="CountUp()">a</input>
<input type="radio" name="b" value="b"  önclick="CountUp()">b</input>

<div id="result">0</div>

<script type="text/javascript">
var counter = 0;

function countUp() {
    document.getElementById("result").innerHTML = counter;
Share this answer
Member-2338430 20-Feb-12 9:48am    
but I use radiobuttonlist item I didnt use radiobutton

radiobuttonlist not has onclick even

I have radiobuttonlist and radiobuttonlist items
The Zetta 20-Feb-12 9:52am    
there is no radiobuttonlist element in html. every radiobuttonlist generates html code like above. if you are doing it with ASP.NET, like c#, you need to set each generated radiobutton's onclick attribute. something like this :

foreach(ListItem RadioButton in RadioButtons){
RadioButton.Attributes.Add("onclick", "countUp();");
In each of the input type="radio" ... objects that are in your html you will have an onclick handler that will hit a javascript method similar to what The Zetta has shown above.
In that onclick handler you will have to loop through the DOM objects and count the number of radio items that are checked and then set the resulting value to the appropriate label that is to show the value
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