Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Hyperlink To different Files....

Posted on 2000-03-16
5
Medium Priority
?
166 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 400 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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

972 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