Solved

Hyperlink To different Files....

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Summernote required 3 57
html select on change 3 25
Change month dropdown 5 15
Apostophes in PHP generated form 6 17
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
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 …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

705 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now