As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I have a radio button group on my html page that has three values. I'm trying to retrieve the value of the selected option using the code below but it doesn't work.
//Begin function radio1_onclick
function radio1_onclick(ctrl) {
var radBut = document.getElementById('radio1');
for (var i=0; i < radBut.length; i++)
{
if (radBut[i].checked == true)
{
alert(radBut[i].value);
}
}
}
//End function radio1_onclick
I get nothing. Not even a script error. Am I missing something?
Thanks,
DanThis message has been edited. Last edited by: Dan Pinault,
7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007
var radBut=document.form_name.radio1.length;
alert(radBut);
for (var i=0; i < radBut; i++)
{
if (document.form_name.radio1[i].checked==true)
alert(document.form_name.radio1[i].value);
}
}
please make sure to give the unique id for all the radio buttons as "radio1".......this may be the problem in your case....... let us know if you got it working........
regards, Anmol.
WebFocus7.6.2, WebFocus 7.1.1,Windows HTML, PDF and Excel
I don't know if it makes a difference or not but I'm using the radio button control from the html layout composer. It looks like this is behaving differently than a 'normal' radio button control.
This looks to me like they are behaving like checkboxes. So, the code I ended up with is...
//Begin function radio1_onclick
function radio1_onclick(ctrl) {
if (document.getElementById('radio1_2').checked==true)
{
//Do this if true
}
else
{
//Do this if false
}
}
//End function radio1_onclick
The reason I am looking to see if the particular radio button (radio1_2) is checked is so I can [enable] or [uncheck and disable] a checkbox (checkbox8). The strange thing is that I need to reference the actual checkbox of checkbox8 as 'item1'! Go figure!!
//Begin function radio1_onclick
function radio1_onclick(ctrl) {
var chkBox = document.getElementById('checkbox8');
if (document.getElementById('radio1_2').checked==true)
{
chkBox.disabled=false;
}
else
{
document.getElementById('item1').checked=false;
chkBox.disabled=true;
}
}
//End function radio1_onclick
Thanks for the help!
Dan
7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007
Notice that while the IBI generated code has different "id=" values, the "name=" value is the same, 'radio1', for all the radio button elements, so you can use that to refer to the collection properties by name, not Id.