...

View Full Version : Hyperlinking based on the date selected



JJBrady
01-15-2003, 04:50 PM
Hi
I am looking for code that does the following:
On daily basis I am recording a morning call and the output name is saved based on the date of that recording, the file name wil be for example 20030114.mp3 because recording was on that day.

I would like to have page with a month view calendar, when user click on a day, the hyperlink should be pointed to the file of that day, for example if user click on 01/15/2003, then sound file name 20030115.mp3 should work.

I hope I get this code here with manay thanks in advance.
JJ

requestcode
01-15-2003, 06:52 PM
You could do something like this:
<HTML>
<HEAD>
<TITLE>Test</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function getfile(fdate)
{
myfile=fdate+".mp3"
alert(myfile)
}
</SCRIPT>
</HEAD>
<BODY>
<A HREF="javascript:getfile('20030115')">Click Here</A><BR>
<A HREF="javascript:getfile('20030114')">Click Here</A>
</BODY>
</HTML>

This passes the date only to the function which tacks on the file extension.

JJBrady
01-15-2003, 10:51 PM
Thanks for your reply
I tried it and it popup a message box with the date mentioned below + the extention defined in the function, what actualy I am looking for is the date to be extracted from the system, so when user click on January 1, 2003 in the month calendar, the link directly goes to the same date name file which will be 20030101.mp3
Hoping I could make my question more clear.
Appreciate your reply

ez4ne12c
01-16-2003, 01:15 AM
have u seen this
http://www.wsabstract.com/script/script2/timestamp.shtml
ez

JJBrady
01-16-2003, 09:40 AM
I have do a small change to the code at the end lines by entering the string today and now when clcik on the link on today for example 01/17/2003, the pop up message will read 17.mp3, this great approach for me at least, I wonder if ther is other value for the current year and current month to get all the date:
<HTML>
<HEAD>
<TITLE>Test</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function getfile(fdate)
{
myfile=fdate+".mp3"
alert(myfile)
}
</SCRIPT>
</HEAD>
<BODY>
<A HREF="javascript:getfile(today)">Click Here</A><BR>
<A HREF="javascript:getfile(today)">Click Here</A>
</BODY>
</HTML>

ez4ne12c
Thanks for the link, I will give it a try and hope meet my requirement.
Thanks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum