Forum Moderators: open

Message Too Old, No Replies

Display Date Automatically

using javascript "padout"

         

Yangtze

7:56 am on Oct 10, 2004 (gmt 0)

10+ Year Member



I ran a travel site, it has lots of itineraries, like
Day One: Place #*$!
Activity....
Day Two: Place xxx
Activity...
Day Three: Place xxx
Activity...

These tours have certian departure dates.
I designed a calendar, with these available dates highlighted

I am looking for a way that, when you click on a desired date, the itinerary will show the dates.

For an exmaple, if Dec.25,2004 is an available departure date, when you click on it, then the tour itinerary will show the dates as below:
Dec.25: Place xxx
Activity....
Dec.26: Place xxx
Activity....

I saw someome used the following script.

<SCRIPT language=Javascript>
<!--document.write(padout(1));//-->
</SCRIPT>

<SCRIPT language=Javascript>
<!--document.write(padout(2));//-->
</SCRIPT>

<SCRIPT language=Javascript>
<!--document.write(padout(3));//-->
</SCRIPT>

.....

How can I can inplement this script with the calender page and itinerary page?
Should I set up some kind of triger on the calender page?

Thanks in advance

Rambo Tribble

1:22 am on Oct 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm afraid your post may invite more questions than answers. In order for JavaScript to output the information, the information has to be input to JavaScript in an appropriate fashion. This can include entering it manually into variables or an array, or JavaScript can, in many cases, pull the information from the HTML in a page.

I think we'd have to know more about the specifics of where this information is coming from and how and where you want the output. The padout() in your example, is not, by the way, a standard JavaScript method, but a function the author has elsewhere in his/her code, that returns a string for the document.write to display.

rb_john

4:11 am on Oct 15, 2004 (gmt 0)

10+ Year Member



I have a very similar question.

I have a Month drop down field, a Day drop down field and a Year drop down field on my site.

There is an Arrival date selection and a departure date selection. I have code in place to have the departure date adjust by one day after the arrival date by default unless the user changes the value, but I cannot seem to find any input on how to get the three drop down fields representing the Arrival date to preload the current date on page load.