Solved

Hyperlink To different Files....

Posted on 2000-03-16
5
159 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
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…

809 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