Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use form input to create a URL

Status
Not open for further replies.

Keekmo

Programmer
Jan 16, 2005
2
US
My work group uses an HTML document that resides on our LAN. We also use a daily status document that I would like to be able to access from this page. I am trying to create a form containing three input boxes (YYYY, MM, DD) that the user can submit in order to open a document from a previous day. We use the following script to open the current document:
<script>
var date = new Date();
var d = date.getDate();
var day = (d < 10) ? '0' + d : d;
var m = date.getMonth() + 1;
var month = (m < 10) ? '0' + m : m;
var yyyy = date.getFullYear();
var yyyymmdd = yyyy.toString() + month.toString() + day.toString();

document.write("<font face='Verdana'><font color='#000066'><font size=-1><b><u><a href='L:/main/Status/" + yyyymmdd + ".xls' target='_blank'>Click Here For Today's Status</a></u></b>");
</script></td></tr>

Older documents are moved out of the 'Status' directory. For example, the document from March 15, 2004 would be
L:/main/Status/2004/2004_03/20040415.xls
 
And the question is...

--Chessbot

"In that blessed region of Four Dimensions, shall we linger on the threshold of the Fifth, and not enter therein? Ah, no! [...] Then, yielding to our intellectual onset, the gates of the Sixth Dimension shall fly open; after that a Seventh, and then an Eighth -- --" Flatland, A. Square (E. A. Abbott)
 
Sorry about that. I wanted to create a form w/three date fields (yyyy, mm, dd). I would use these fields to open older versions of the document. In other word, if the user entered 2004 > 03 > 15, he would open the document at L:/main/Status/2004/2004_03/20040315.xls.

I think I have my answer, though. Thanks anyway.
 
OK, come back with any problems.

--Chessbot

"In that blessed region of Four Dimensions, shall we linger on the threshold of the Fifth, and not enter therein? Ah, no! [...] Then, yielding to our intellectual onset, the gates of the Sixth Dimension shall fly open; after that a Seventh, and then an Eighth -- --" Flatland, A. Square (E. A. Abbott)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top