File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes UnChecking a single radio button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "UnChecking a single radio button" Watch "UnChecking a single radio button" New topic
Author

UnChecking a single radio button

Songezo Nkukwana
Ranch Hand

Joined: Nov 27, 2008
Posts: 51
I have a dynamic list of radio buttons created at run time. This list can be anything from 1 (1 Item and its Radio button). But my javascript seems to only cater for 2 or more radio buttons. My attempt is to uncheck a selected radio button when a clear button next to each radio is clicked.



This only works when the list of Radio buttons is more than 1 (the for loop) ... btngrp is a property of a form bean declared as String radioButtons passed as: onclick = "unCheckRadio(radioButtons ); " ... Is there a better or working way to solve this problem when only a single Radio button is created?
Songezo Nkukwana
Ranch Hand

Joined: Nov 27, 2008
Posts: 51
Songezo Nkukwana wrote:I have a dynamic list of radio buttons created at run time. This list can be anything from 1 (1 Item and its Radio button). But my javascript seems to only cater for 2 or more radio buttons. My attempt is to uncheck a selected radio button when a clear button next to each radio is clicked.



This only works when the list of Radio buttons is more than 1 (the for loop) ... btngrp is a property of a form bean declared as String radioButtons passed as: onclick = "unCheckRadio(radioButtons ); " ... Is there a better or working way to solve this problem when only a single Radio button is created?


oops! btngrp.checked == false; should be btngrp.checked = false; ...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: UnChecking a single radio button