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'm trying to add a situation to the html page. If certain values in the dropdown is selected then checkbox A should appear otherwise checkbox B should appear. Can anybody please suggest, how this can be done?
Thanks in advance.This message has been edited. Last edited by: <Emily McAllister>,
In my example, the dropdown has a unique identifier of "combobox1". Next to it are two checkboxes, identified as "checkbox1" and "checkbox2". Both checkboxes occupy the same position on the HTML page (i.e., they are on top of each other).
Here are the choices in my dropdown:
Apple
Lemon
Lettuce
Pear
Radish
Tomato
Three of these are fruits, and three are vegetables (Okay, okay, I'm going to make "Tomato" a vegetable, even though it is considered a fruit). When a fruit is selected, checkbox1 (A) shows "Deliver Fruit?". When a vegetable is selected, checkbox2 (B) shows "Deliver Vegetable?".
Here is the embedded JavaScript code to show the correct checkbox for the dropdown:
// After HTML page loads, show the correct checkbox
function combobox1_ononafterload(ctrl) {
show_checkbox();
}
// When dropdown choice has been changed, show the correct checkbox
function combobox1_onchange(event) {
show_checkbox();
}
// Code to determine which checkbox should appear
function show_checkbox() {
document.getElementById("checkbox1").style.display = "none";
document.getElementById("checkbox2").style.display = "none";
var a = document.getElementById("combobox1");
var choice = a.options[a.selectedIndex].value;
if ( choice == "Apple" ||
choice == "Lemon" ||
choice == "Pear" ) {
document.getElementById("checkbox1").style.display = "block";
}
else {
document.getElementById("checkbox2").style.display = "block";
}
}
App Studio WebFOCUS 8.1.05M Windows, All Outputs
Posts: 594 | Location: Michigan | Registered: September 04, 2015
Originally posted by MeM: Thank you Squatch. Is there any way, I can just do without writing the code?
I can't think of a way right now, maybe someone else knows how.
I assume you are using App Studio because you are on WebFOCUS 8.1. There is an Embedded JavaScript/CSS tab at the bottom of App Studio. As long as your controls are named the same as in my example, you should be able to paste the code in that place after any code that is already there (And making any logic changes needed to match your needs -- your dropdown will have different values, of course).
If the names of your controls are different, just replace all references to combobox1, checkbox1 and checkbox2 to whatever the names of your controls are.
App Studio WebFOCUS 8.1.05M Windows, All Outputs
Posts: 594 | Location: Michigan | Registered: September 04, 2015