Solved

Hyperlink To different Files....

Posted on 2000-03-16
5
160 Views
Last Modified: 2010-04-09
I have a page where I have alot of hyperlinks to Excel files.  The files are all in the same location but are saved each day as different name according to the date it was created.  What I want to achive is that on my page i'll have 3 Textboxes and a submit button. The files that I want to link to looks something like this. C:\Emn01\Flash\Flash_15_03_00.xls. Now every day as I said, a new file is created the "_15_03_00" indicates the following Day,Month,Year. The textboxes on my form are also Day,Month,Year. The moment I insert data in the textboxes and click the submit button it must then link to the date according to the data I inserted in the text boxes. E.G. If I inserted 17 in the Day textbox, 04 in the Month Text Box and 99 in the Year text box and then click the Submit button I should be directed to "C:\Emn01\Flash\Flash_17_04_99.xls".
0
Comment
Question by:FV
  • 2
  • 2
5 Comments
 
LVL 8

Expert Comment

by:xabi
ID: 2623882
Try this:

..
..
<script language="javascript">
<!--
function checkit() {
 idForm = document.myform
 sTmp =  "C:\Emn01\Flash\Flash"
 sTmp += "_" + idForm.myday.value
 sTmp += "_" + idForm.mymonth.value
 sTmp += "_" + idForm.myyear.value + ".xls"
 idForm.action = sTmp
 return true
}
//-->
</script>
</head>
<html>
<form name="myform" onsubmit="return(checkit())">
 <input type="text" size="2" name="myday"><br>
 <input type="text" size="2" name="mymonth"><br>
 <input type="text" size="4" name="myyear"><br>
 <input type="submit">
</form>
..
..


xabi
0
 

Author Comment

by:FV
ID: 2624038
xabi,

I tried it. When I click the submit button nothing happens. What do you think Im doing wrong?
0
 
LVL 8

Accepted Solution

by:
xabi earned 100 total points
ID: 2624222
Try this other script, it works for me:

---------- 8< ------- 8< ----------
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<script language="javascript">
<!--
function checkit() {
 idForm = document.myform
 sTmp =  "file:///C|/Emn01/Flash/Flash"
 sTmp += "_" + idForm.myday.value
 sTmp += "_" + idForm.mymonth.value
 sTmp += "_" + idForm.myyear.value + ".xls"
 alert("Downloading file: " + sTmp)
 idForm.action = sTmp
 return true
}
//-->
</script>
</head>
<html>
<form name="myform" action="" method ="get" onsubmit="return(checkit())">
 <input type="text" size="2" name="myday"><br>
 <input type="text" size="2" name="mymonth"><br>
 <input type="text" size="4" name="myyear"><br>
 <input type="submit">
</form>
</BODY>
</HTML>
------------- 8< --------- 8< --------

xabi
0
 
LVL 19

Expert Comment

by:daveamour
ID: 2624548
xabi - do you spend all day on here?

If I look at a basket weaving or walrus polishing question , will you have answered that too?
0
 

Author Comment

by:FV
ID: 2625090
Thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article discusses four methods for overlaying images in a container on a web page
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question