Focal Point
Disabling a calendar

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7267080316

November 18, 2011, 02:36 PM
swetha
Disabling a calendar
Hi,

In my Launchpage I have a text box for Year,Calendar control for From and Calendar control for To.
When the user enters a year in the textbox,the calendar controls should be disabled and when the user enters From or To date the textbox should be disabled.I am able to disable the text box.But I am not able to disable the Calendar controls.I am using the Disabled property of the calendar.only the textbox of the control is getting disabled but not the calendar icon.I am still able to click the calendar icon and select a date.This is not the behaviour I wanted.

The event I am using is onkeyup="toggleFromTo2('edit1', 'calendar1', 'calendar2')"

  

function toggleFromTo2(yearInput, fromInput, toInput) {
	
			
	 	if  ((document.getElementById(yearInput).value != "" || document.getElementById(yearInput).value.length > 0)) {
		document.getElementById(fromInput).disabled = true;
		document.getElementById(toInput).disabled = true;
		document.getElementById(fromInput).style.backgroundColor = "gray";
		document.getElementById(toInput).style.backgroundColor = "gray";
	}
	//otherwise enable the From and To fields
	else {
		document.getElementById(fromInput).disabled = false;
		document.getElementById(fromInput).style.backgroundColor = "";
		document.getElementById(toInput).disabled = false;
		document.getElementById(toInput).style.backgroundColor = "";
	}	
}




Could someone tell me where I am going wrong.The other issue I am having is when I enter the date in the calendar textbox manually only it disables the year textbox.when I use the calendar icon to select a date it doesnot disable the year textbox.

Am I using the wrong event.Could someone suggest a solution.
Thanks.


WebFOCUS 7.6.7
windows
Html,Pdf and Excel
November 18, 2011, 03:03 PM
j.gross
Funny you should ask; I hit that too this week, in 7.7.03.
November 20, 2011, 04:12 PM
Waz
Wasn't there just a huge thread dedicated to disabling the calendar control ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

November 21, 2011, 10:55 AM
ABT
i created a white shim graphic, set the z-index to 1, and placed it over the calendar control icon. You can't natively touch it.

- ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
November 21, 2011, 12:40 PM
Doug
quote:
Wasn't there just a huge thread dedicated to disabling the calendar control ?
Here's a few of them




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
November 21, 2011, 01:27 PM
swetha
Hi Doug,

The link you provided doesn't work.Could you check it once again.
Thankyou.


WebFOCUS 7.6.7
windows
Html,Pdf and Excel
November 21, 2011, 02:15 PM
Francis Mariani
This is a discussion on how to disable the calendar control image:

DS HTML Composer: Calendar control icon


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
November 22, 2011, 12:49 PM
swetha
The other problem I have is when I select a date using the calendar icon,the year textbox doesn't disable.When I enter the date manually in the calendar textbox,the year textbox is disabled.

Here is my code.

function toggleYear(fromInput, toInput, yearInput) {
	//if the From or To fields contain anything, disable the year input
	if ((document.getElementById(fromInput).value != "" || document.getElementById(fromInput).value.length > 0) ||
		(document.getElementById(toInput).value != "" || document.getElementById(toInput).value.length > 0)) {
			
			document.getElementById(yearInput).disabled = true;
			document.getElementById(yearInput).style.backgroundColor = "gray";
	}
	//otherwise enable them
	else {
		
		document.getElementById(yearInput).disabled = false;
		document.getElementById(yearInput).style.backgroundColor = "";
	}	
}  


In the HTML I have the event onkeyup="toggleYear('calendar22', 'calendar23', 'edit37')" for both the calendars.Should I use someother event? Could someone help.

Thanks


WebFOCUS 7.6.7
windows
Html,Pdf and Excel