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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Radio button" Watch "Radio button" New topic
Author

Radio button

santhoshK babu
Greenhorn

Joined: Jul 25, 2006
Posts: 22
Hi,
I have more than three hundread radion button in jsf form view . I want to get a value of each radio button in javascript. I tried in this way alert (document.getElementById("radioid").value), but it replays undefined. So please anyone help to resolve this problem.

Thanks,
santhosh.
Subrahmanyam Baratam
Greenhorn

Joined: Nov 24, 2008
Posts: 13
Hi,

Try to use this.value when you click the radio button.
santhoshK babu
Greenhorn

Joined: Jul 25, 2006
Posts: 22
Hi,

You are right. But my things is when form is load, on that time i need to get a value of paricular radio button. Please advice for this problem.
Bart Kummel
author
Ranch Hand

Joined: Nov 30, 2007
Posts: 81
Hi,

The problem could be that the ID in the (X)HTML page that is generated is not necessarily the same as the ID you gave to the JSF component. That said, some component sets allow you to set a forced ID to be generated in the resulting (X)HTML page. For example Apache MyFaces Tomahawk has "extended components" with a forceId argument. If you're using Tomahawk you could use this feature. Or you could dive into the documentation of the component set that you're using to see if there's a comparable feature. Hope this helps!

Best regards,
Bart Kummel


SCJP 1.4 | SCJD 1.6 | Visit my website | Author of the book Apache MyFaces 1.2 Web Application Development
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Radio button
 
Similar Threads
Selected radio button value to be send to action class
get table values from jsp to servlet
Radio Button
passing hidden values
JRadioButton