• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Select one radio button and display the value in java script

 
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is my jsp code (i have pasted only the required portion)


Javascript code :

var1=document.getElementById("adminPanel:adminForm:rptType"); // this gives me a HtmlTAbleObject
alert(var1.value); // gives me a null value here . i presume sthg wrong in the above statement..

Kindly advise how I can get the value of the radio button thats clicked from inside my javascript function.
Is it mandatory to use binding or value along with <h:selectOneRadio to get the button thats clicked..???
 
Ranch Hand
Posts: 41
Google Web Toolkit Tomcat Server Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First please you use a managed bean.
Second the value attribute of the selectOne... will contain the selected value (for eg


should be

please use the managed bean.
 
You got style baby! More than this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic