Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [sOLVED} -HTML Help Please

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[sOLVED} -HTML Help Please
 Login/Join
 
Gold member
posted
I have some HTML code that I have used in the past to disable or Gray Out variables on the page. However I always used it based on the selection from a Radio button or Checkbox. Where you just check for TRUE I now need to do the same based on the selection from a dropdown list or combobox.

I have a dropdown list or Combobox with several selections :
'None'
Last Month
Last six Months
Last year
EOM
Range

Unless EOM or Range is selected I have no need for the user to select a date so I would like to grey out or disable the date selection unless EOM or Range is selected.

Can this be done and does anyone have an example

Thank you

This message has been edited. Last edited by: Dgraff,


Duane

WebFOCUS 8.0.7
DS 8.0.7 AS 8.0.7
Windows
Output: Excel, HTML, PDF, AHTML,Mobile
In Focus 1982
 
Posts: 83 | Location: Princeton NJ | Registered: October 26, 2007Report This Post
Virtuoso
posted Hide Post
There is an example of showing conditional hidding and unhidding of controls in this year's summit presentations. Look for presentations by David Glick. Hopefully someone else here can present you with the URL for the summit presentations, as I cannot remember the specific link.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Virtuoso
posted Hide Post
Sorry - I'm not an HTML/javascript guru (far from it) so someone else can probably fill in the details here. There is an "onchange" event for a control which you can have check the selectedIndex property of your control to see if it is 4 (EOM) or 5 (Range) and enable your other controls. Otherwise they should be .disable'd

This message has been edited. Last edited by: Darin Lee,


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Expert
posted Hide Post
Here's a concept off the web, you can just copy it into a new HTML file in WebFOCUS and run it.
It's off the Web because I'm not even in Darin's class!! Smiler


  
<html>
<head>
<script type="text/javascript">
function doClick(objRad){
if (objRad.value=="0"){ 
document.getElementById("textbox").style.display='none'; //hide textbox
document.getElementById("otherOpt").style.display='block'; //show other options
}
else{ 
document.getElementById("otherOpt").style.display='none'; //hide other options
document.getElementById("textbox").style.display='block'; //show textbox
}
}
</script>
</head>
<body>
<form name="myform">
<table>
<tr>
<td>
<input type="radio" name="rad" value="0" onclick="doClick(this)">Other options
</td>
<td>
<div id="otherOpt" style="display:none">
<input type="radio" name="rad2" value="0">Option 1
<input type="radio" name="rad2" value="1">Option 2
</div>
</td>
<tr>
<td>
<input type="radio" name="rad" value="1" onclick="doClick(this)">Show textbox
</td>
<td>
<div id="textbox" style="display:none">
<input type="text" name="txt">
</div>
</td>
</form>
</body>
</html>



Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Gold member
posted Hide Post
Tom ,
I too like you and Darrin am not an expert you found the piece of code I used in the past to hide unhide a textbox by using a radio button. But as I stated above I now need to do the same based on the selection from a dropdown list or combobox. I've tried modifing the Radio button code with no luck.


Duane

WebFOCUS 8.0.7
DS 8.0.7 AS 8.0.7
Windows
Output: Excel, HTML, PDF, AHTML,Mobile
In Focus 1982
 
Posts: 83 | Location: Princeton NJ | Registered: October 26, 2007Report This Post
Guru
posted Hide Post
Dgraff,

Here's something I've used...
var Varlist = document.getElementById('combobox1');

for(var x=0; x < Varlist.options.length; x++)                         //iterate through the options in the combobox
    {
    if (Varlist.options[Varlist.selectedIndex].value == 'TEST_VALUE') //test selected option against some value
	{
		doSomething;                                        //what to do if selected option matches test value
	}
    else
         {
                  doSomethingElse;                                    //what to do if selected option does NOT match test value
         }
    }

I think you may be able to skip the iteration and go right to testing the selected value. I'm not a javascript whiz either and I found this on the web. Hope it helps.

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, 2007Report This Post
Expert
posted Hide Post
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN'
    'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>

<html xmlns='http://www.w3.org/1999/xhtml' lang='en' xml:lang='en'>

<head>

<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<meta http-equiv='Content-Style-Type' content='text/css' />

<title>Test Select</title>

<script type='text/javascript'>
function displaySelected()
{
a = document.getElementById('select1');
if (a[a.selectedIndex].value == '2')
  {
  document.getElementById('select2label').style.color = 'gray';
  document.getElementById('select2').disabled = true;
  }
else
  {
  document.getElementById('select2label').style.color = 'black';
  document.getElementById('select2').disabled = false;
  }
}
</script>
</head>

<body>
<form method='post' action=''>

<div style='margin: 10px;'>
<span id='select1label'>Select 1</span>
<select id='select1' onchange='displaySelected();'>
<option value='1' selected='selected'>A</option>
<option value='2'>B</option>
<option value='3'>C</option>
</select>
</div>

<div style='margin: 10px;'>
<span id='select2label'>Select 2</span>
<select id='select2'>
<option value='11'>AA</option>
<option value='22'>BB</option>
<option value='33'>CC</option>
</select>
</div>

</form>
</body>
</html>

This message has been edited. Last edited by: Francis Mariani,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Thanks Francis. That's exactly along the lines of what I was trying to describe. Except you want them disabled to start with and then only enable them if option EOM or RANGE is selected.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [sOLVED} -HTML Help Please

Copyright © 1996-2020 Information Builders