here is the calling page:
<cf_formFieldCalendar image="images/arrow_d.gif" align="middle"
alt="Calendar" border="0" formname="frmSearchInCheck" target="dateMax">


tag:
<!--
CF_CAL Custom Tag


Jason Bukowski
4 Brattle Circle
Cambridge, MA 02138
6/28/2000


UPDATED 7/11/2000
- Fixed Netscape bug
- Fixed Multiple Instances Bug
- Minor UI Improvment


[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>


CF_CAL is designed to place a button that activates a popup calendar. The
user may browse though the calendar and select and date he wants by clicking
on it. That date is then send back to a definded text field in a defined
form in the format MM/DD/YYYY.


To Use:
Paramteres-- formname target date image


REQUIRED:
formname - the name of the form you want the date inserted into
target - the name of the text field in that form
OPTIONAL
date - the date the calendar opens to. Default is current.
image - the graphic to appear as the button. Default is [C] -- path is
relative to calling page.
-->
<cftry>


<cfif parameterexists(attributes.target) EQ 0>
<cfthrow message="NoTarget">
<cfelseif parameterexists(attributes.formname) EQ 0>
<cfthrow message="NoTarget">
</cfif>

<cfparam name="attributes.date" default="#Now()#">
<cfparam name="attributes.image" default="0">


<cfoutput>
<script language="_javascript_">


var months = new
Array("January","February","March","April","May","June","July","August","Sep
tember","October","November","December")
var totalDays = new Array(31,28,31,30,31,30,31,31,30,31,30,31)

function openCalWin_#attributes.target#() {
stats='toolbar=no,location=no,directories=no,status=no,menubar=no,'
stats += 'scrollbars=no,resizable=no,width=300,height=250'
CalWin = window.open ("","Calendar",stats)

var calMonth = #DateFormat(attributes.date, "M")#
var calYear = #DateFormat(attributes.date, "YYYY")#

theDate = new Date(calYear, (calMonth - 1), 1)

buildCal_#attributes.target#(theDate)


}


function buildCal_#attributes.target#(theDate) {

var startDay = theDate.getDay()
var printDays = false
var currDay = 1
var rowsNeeded = 5

if (startDay + totalDays[theDate.getMonth()] > 35)
  rowsNeeded++

CalWin.document.write('<html><head><Title>Select a Date</title>')
CalWin.document.write('<STYLE TYPE="text/css">')
CalWin.document.write('A { color: ##000000;
font-family:Verdana;font-size:12px; font-weight: normal; text-decoration:
none; padding:0em .5em;}')
CalWin.document.write('A:hover { color: ##cc6600; background-color:
##ecf4f7; padding:0em .5em; }')
CalWin.document.write('body { background: ##ffffff; }')
CalWin.document.write('</STYLE></head>')
CalWin.document.write('<body><a name="this"></a>')
CalWin.document.write('<table align=center height=100% width=100% border=0
bordercolor=##ffffff cellpadding=0 cellspacing=0>')
CalWin.document.write('<tr><th bgcolor="##b2d9ec" colspan=7><font
face=Verdana color=##006699 size=2>' + months[theDate.getMonth()] + ' ' +
theDate.getFullYear() + '</font></th></tr>')
CalWin.document.write('<tr bgcolor="##ecf4f7"><th><font face=Verdana
color=##006699 size=1>Su</font></th><th><font face=Verdana color=##006699
size=1>Mo</font></th><th><font face=Verdana color=##006699
size=1>Tu</font></th><th><font face=Verdana color=##006699
size=1>We</font></th><th><font face=Verdana color=##006699
size=1>Th</font></th><th><font face=Verdana color=##006699
size=1>Fr</font></th><th><font face=Verdana color=##006699
size=1>Sa</font></th></tr>')
for (x=1; x<=rowsNeeded; x++){
  CalWin.document.write('<tr>')
  for (y=0; y<=6; y++){
   if (currDay == 1 && !printDays && startDay == y)
    printDays = true
   CalWin.document.write('<td align="center" width=14.28%>')
   if (printDays){
          CalWin.document.write('<a
href="" + theDate.getMonth()
+ ',' +  currDay + ',' + theDate.getFullYear() + ')">' + currDay++ +
'</a></td>')
    if (currDay > totalDays[theDate.getMonth()])
     printDays = false
   }
   else
    CalWin.document.write('&nbsp;</td>')
  }  
  CalWin.document.write('</tr>')
}
CalWin.document.write('<form><tr bgcolor="##ecf4f7"><td colspan=7
align="center"><input type="image" src="" align="middle"
alt="" border="0" name="Backward" value="<<"
face=Verdana
color=##006699 size="1"> Arrows browse through the months.</font> <input
type="image" src="" align="middle" alt="" border="0"
name="Forward" value=">>"
> CalWin.document.write('</table></body></html>')
CalWin.document.close()


}


function getNewCal_#attributes.target#(newDir) {
if (newDir == -1){
  theDate.setMonth(theDate.getMonth() - 1)
  if (theDate.getMonth() == 0){
   theDate.setMonth(12)
   theDate.setYear(theDate.getYear() - 1)
  }
}
else if (newDir == 1){
  theDate.setMonth(theDate.getMonth() + 1)
  if (theDate.getMonth() == 13){
   theDate.setMonth(1)
   theDate.setYear(theDate.getYear() + 1)
  }
}
  
  
CalWin.document.clear();
buildCal_#attributes.target#(theDate);


}


function placeDate_#attributes.target#(monthNum, dayNum, yearNum){
var dateString = (monthNum + 1) + '-' + dayNum + '-' + yearNum

document.#attributes.formname#.#attributes.target#.value = dateString
   
CalWin.close()
}


</script>


<cfif #attributes.image# NEQ 0>
<a href=""> src="" border=0></a>
<cfelse>
<a href=""> </cfif>
</cfoutput>


<cfcatch type="Any">
<script language="_javascript_">
alert("You must supply a value for the FORMNAME & TARGET attributes!")
</script>
</cfcatch>
</cftry>

-----Original Message-----
From: Schuster, Steven [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 09, 2003 11:43 AM
To: CF-Talk
Subject: RE: JS help

Can you send the code from the calling page and custom tag?

Steve

-----Original Message-----
From: Tim Do [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 09, 2003 2:33 PM
To: CF-Talk
Subject: RE: JS help

that is correct.

-----Original Message-----
From: Schuster, Steven [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 09, 2003 11:34 AM
To: CF-Talk
Subject: RE: JS help

So there are no internal links using http:// within the custom tag itself
and when you call it externally you are using https:// correct?

Steve

-----Original Message-----
From: Tim Do [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 09, 2003 2:16 PM
To: CF-Talk
Subject: RE: JS help

There is no http anywhere... the calendar is all rendered inside the custom
tag.

-----Original Message-----
From: Schuster, Steven [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 09, 2003 11:20 AM
To: CF-Talk
Subject: RE: JS help

Make sure the tag code does not use http:// anywhere is one way.

Steve

-----Original Message-----
From: Tim Do [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 09, 2003 2:10 PM
To: CF-Talk
Subject: OT: JS help

Hello all,

I'm trying to use a calendar custom tag (cf_formFieldCalendar) inside a
secure directory.   Inside the tag it has a window.open command that spawns
a window.  When it does, the browser prompts that you're leaving a secure
area.  The tag is inside the secure directory.  Can anybody tell me how to
get it so the browser doesn't prompt the user that they're leaving a secure
area?

Thanks in advance,
Tim

Here is a piece of the js:

function openCalWin_#attributes.target#() {
stats='toolbar=no,location=no,directories=no,status=no,menubar=no,'
stats += 'scrollbars=no,resizable=no,width=300,height=250'
CalWin = window.open ("","Calendar",stats)
  _____
  _____
  _____
  _____
  _____
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to