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.
New TIBCO Community Coming Soon
In early summer, TIBCO plans to launch a new community—with a new user experience, enhanced search, and expanded capabilities for member engagement with answers and discussions! In advance of that, the current myibi community will be retired on April 30. We will continue to provide updates here on both the retirement of myibi and the new community launch.
What You Need to Know about Our New Community
We value the wealth of knowledge and engagement shared by community members and hope the new community will continue cultivating networking, knowledge sharing, and discussion.
During the transition period, from April 20th until the new community is launched this summer, myibi users should access the TIBCO WebFOCUS page to engage.
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.