This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Radio button

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Try to use this.value when you click the radio button.
 
santhoshK babu
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
author
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
They worship nothing. They say it's because nothing lasts forever. Like this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic