Forum Moderators: phranque

Message Too Old, No Replies

Need a Nice Popup calendar like this one

         

Yangtze

5:17 pm on Mar 27, 2004 (gmt 0)

10+ Year Member



Does anyone hhappen to know a similar calendar like the Holiday Inn's?

When you select, say March 1, 2004 for the check-in date, the check-out date will be immidately changed to March 2, 2004, without the need to use the calendar again.

Thanks.

---------
I was searching online during the past week with the hope to find the solution by myself, but failed.

So I turned to webmasterworld.com.
I hope the link has not offensed this board's rules.

Thanks again

[edited by: Woz at 11:30 pm (utc) on April 3, 2004]
[edit reason] No URLs please [/edit]

Yangtze

5:45 pm on Mar 27, 2004 (gmt 0)

10+ Year Member



They have the following code, but I'm not sure if it's this code working behind the screen.

<script language="javascript">
// <!--
function openCalendarCheckIn()
{
var theForm = document.searchForm;
var cDate = theForm.checkInDate[theForm.checkInDate.selectedIndex].value;
var cMonthYear = theForm.checkInMonthYear[theForm.checkInMonthYear.selectedIndex].value;
var url = '/h/d/hi/280/zh/calendar?monthYear=' + cMonthYear + '&date=' + cDate + '&checkOut=false&secure=false';
if(navigator.userAgent.indexOf("AOL 6.0")!= -1 ¦¦ navigator.userAgent.indexOf("AOL 5.0")!= -1) {
newWin = window.open(url,'HI','DEPENDANT=YES,WIDTH=225,HEIGHT=230,TITLEBAR=YES,STATUS=YES,MENUBAR=NO,SCROLLBARS=NO,TOP=0,LEFT=0');
} else {
var topPos = (screen.availHeight/2)-115;
var leftPos = (screen.availWidth/2)-105;
newWin = window.open(url,'cal','top=' + topPos + ',left=' + leftPos + ',dependent=yes,width=225,height=230,screenX=' + leftPos + ',screenY=' + topPos + ',titlebar=yes');
}
newWin.focus();
return false;
}

function openCalendarCheckOut()
{
var theForm = document.searchForm;
var cDate = theForm.checkOutDate[theForm.checkOutDate.selectedIndex].value;
var cMonthYear = theForm.checkOutMonthYear[theForm.checkOutMonthYear.selectedIndex].value;
var url = '/h/d/hi/280/zh/calendar?monthYear=' + cMonthYear + '&date=' + cDate + '&checkOut=true&secure=false';
if(navigator.userAgent.indexOf("AOL 6.0")!= -1 ¦¦ navigator.userAgent.indexOf("AOL 5.0")!= -1) {
newWin = window.open(url,'HI','DEPENDANT=YES,WIDTH=225,HEIGHT=230,TITLEBAR=YES,STATUS=YES,MENUBAR=NO,SCROLLBARS=NO,TOP=0,LEFT=0');
} else {
var topPos = (screen.availHeight/2)-115;
var leftPos = (screen.availWidth/2)-105;
newWin = window.open(url,'cal','top=' + topPos + ',left=' + leftPos + ',dependent=yes,width=225,height=230,screenX=' + leftPos + ',screenY=' + topPos + ',titlebar=yes');
}
newWin.focus();
return false;
}

function populateCheckOut()
{
var theForm = document.searchForm;
if ((theForm.checkOutMonthYear.selectedIndex == 0) ¦¦
(theForm.checkOutMonthYear.selectedIndex < theForm.checkInMonthYear.selectedIndex) ¦¦
((theForm.checkOutMonthYear.selectedIndex == theForm.checkInMonthYear.selectedIndex) &&
(theForm.checkOutDate.selectedIndex <= theForm.checkInDate.selectedIndex))) {
if(theForm.checkInMonthYear.selectedIndex!= 0) {
if (theForm.checkInDate.selectedIndex > 29 ) {
theForm.checkOutDate.selectedIndex = 1;
theForm.checkOutMonthYear.selectedIndex = theForm.checkInMonthYear.selectedIndex + 1;
}
else if ((theForm.checkInDate.selectedIndex == 29 ) &&
((theForm.checkInMonthYear.selectedIndex == 4) ¦¦
(theForm.checkInMonthYear.selectedIndex == 6) ¦¦
(theForm.checkInMonthYear.selectedIndex == 9) ¦¦
(theForm.checkInMonthYear.selectedIndex == 11))) {
theForm.checkOutDate.selectedIndex = 1;
theForm.checkOutMonthYear.selectedIndex = theForm.checkInMonthYear.selectedIndex + 1;
}
else {
theForm.checkOutDate.selectedIndex = theForm.checkInDate.selectedIndex + 1;
theForm.checkOutMonthYear.selectedIndex = theForm.checkInMonthYear.selectedIndex;
}
}
}
}

//-->
</script>

Yangtze

5:54 pm on Mar 27, 2004 (gmt 0)

10+ Year Member



I heard someone say that I can use "dateadd" Not sure how to do.

ArgIl

1:58 pm on Apr 1, 2004 (gmt 0)



Adding the index.html will allow you to view the source of that site... Then you should be able to figure out what .js file is used for the calendar and from it you can find out where the calendar script came from ( if it was commented properly ).

[edited by: Woz at 11:31 pm (utc) on April 3, 2004]
[edit reason] No URLs please, TOS #13 [/edit]