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 Clicking the text selects the radio button Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Clicking the text selects the radio button" Watch "Clicking the text selects the radio button" New topic
Author

Clicking the text selects the radio button

Satish Kulkarni
Ranch Hand

Joined: Jul 19, 2003
Posts: 60
Hi,
I have 3 radio buttons like

* Pass * Fail * Unknown

When the user clicks on text "Fail" I want the corresponding radio button to the selected. How can I do this in Javascript. Is there already such a javascript that I can use.

Thanks,

Regards,
Satish
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
@#111;nclick="document.formname.CBName[0].selected=true"
@#111;nclick="document.formname.CBName[1].selected=true"
@#111;nclick="document.formname.CBName[2].selected=true"
 
 
subject: Clicking the text selects the radio button
 
Threads others viewed
how do i make a radio button to be checked when a page loads up?
radio button using javascript DOM
selectOneRadio - javascript get value
how to hide some component using javascript
making the textbox readonly
developer file tools