XPages & Radio Button Values

I am in need of assistance. I have been searching for quite some time now. I recall having a similar issue with getting the values of a radio button in the notes client in the past.

I am unable to get the value of a radio button. I am trying to build a report and based upon the value of my radio buttons it will determine whether or not to give a numeric field a value.

I am initially using a button to alert the value, but I am stuck. I have an xpage with two radio buttons in the same group pointing to the same field within the form.

Here is the code I am executing from the button.

var val1=document.getElementById(“#{id:rdoyA1}”);

alert("Here is the value: " + val1);

Subject: Re:Getting value of radio button

I take it you’re trying to get the value in client-side Javascript, am I correct?

If you look at the source returned by the browser, you’ll probably see that the id you’re picking up is assigned to an HTML table, which is why you’re hitting the problems.

Also you’re code is returning an object in your alert.

My series on radio button validation has an example using dojo.query to check the checked element’s value. Look at the sample database, at option2Validation client-side script library. The code is shown on this post: http://hermes.intec.co.uk/Intec/Blog.nsf/dx/21092009135442HERH6A.htm?opendocument

Regards

Paul