Forum Moderators: open

Message Too Old, No Replies

Drop Down Menu displays date specific <a href>

Current Date changes displayed links

         

risk32

12:11 pm on Jan 17, 2008 (gmt 0)

10+ Year Member



Here's what I have so far...
'By far I am entirely not sure on what to do at this point'

_____________________________________________________________________
<html>
<script type="text/javascript">
var monthtext=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec'];
function populatedropdown(dayfield, monthfield, yearfield){
var today=new Date()
var dayfield=document.getElementById(dayfield)
var monthfield=document.getElementById(monthfield)
var yearfield=document.getElementById(yearfield)
for (var i=0; i<31; i++)
dayfield.options[i]=new Option(i+1, i+1)
dayfield.options[today.getDate()]=new Option(today.getDate(), today.getDate(), true, true)
//select today's day
for (var m=0; m<12; m++)
monthfield.options[m]=new Option(monthtext[m], monthtext[m])
monthfield.options[today.getMonth()]=new Option(monthtext[today.getMonth()],
monthtext[today.getMonth()], true, true) //select today's month
var thisyear=today.getFullYear()
for (var y=0; y<20; y++){
yearfield.options[y]=new Option(thisyear, thisyear)
thisyear+=1
}
yearfield.options[0]=new Option(today.getFullYear(), today.getFullYear(), true, true)
//select today's year
}
</script>
<form action="" name="someform">
<select id="daydropdown">
</select>
<select id="monthdropdown">
</select>
<select id="yeardropdown">
</select>
</form>
<script type="text/javascript">
//populatedropdown(id_of_day_select, id_of_month_select, id_of_year_select)
window.onload=function(){
populatedropdown("daydropdown", "monthdropdown", "yeardropdown")
}
</script>
</html>
_____________________________________________________________________

I'm trying get make a <input type="submit" value="Go" onclick=""> button to display date specific links within another page "duty_desk_setup_items.html". (IE. 17 Jan 2008 displays links regarding "17 Jan 2008.ppt" or something like that.) I need links to 2 items with the same file name but under different directories.

\SCHEDULE\JANUARY\31\31 JAN.PPT"
\AIRFIELD\JANUARY\31\31 JAN.PPT"

Of course this is not the entire directory due to classification issues...

I have made an entire listing of links to use, however, to conserve space I tried a dropdown method. Through many failures to succeed, I ask for help.

g1smd

1:23 pm on Jan 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



First off, do you need search engines to be able to follow those links and index the content they point to?

Secondly, you'll make the job easier if the files have a simple naming scheme, perhaps the date format defined in RFC 3339 for example. Today is 2008-01-17 under that scheme, and files sort automatically into date order with such a Big-Endian naming scheme.

Thirdly, be aware that having two URLs for the same content causes Duplicate Content problems for a site. By all means have several "routes" to get to the index page that lists that content, but only have one physical URL for the actual content they point to.

That is, you can have an index page at /airfields/2008/january/17/ and another at /schedule/2008/january/17/ but have them both link to the document at /docs/2008/01/2008-01-17.ppt so that there is only one instance of the document that can be indexed.

risk32

2:01 am on Jan 18, 2008 (gmt 0)

10+ Year Member



First off, do you need search engines to be able to follow those links and index the content they point to?
Secondly, you'll make the job easier if the files have a simple naming scheme, perhaps the date format defined in RFC 3339 for example. Today is 2008-01-17 under that scheme, and files sort automatically into date order with such a Big-Endian naming scheme.

Thirdly, be aware that having two URLs for the same content causes Duplicate Content problems for a site. By all means have several "routes" to get to the index page that lists that content, but only have one physical URL for the actual content they point to.

That is, you can have an index page at /airfields/2008/january/17/ and another at /schedule/2008/january/17/ but have them both link to the document at /docs/2008/01/2008-01-17.ppt so that there is only one instance of the document that can be indexed.
_____________________________________________________________________

Would it be possible to write some Javsscript ro reference a database to display specific date - href matched? Ie. Java searches through a database in field one, validates the information listed, and outputs what's listed in field two as html?

field 1: 2008-01-17 field 2: <a href="...\airfield\2008\01\17\2008-01-17.ppt"></a><a href="...\schedule\2008\01\17\2008\01\17\2008-01-17.ppt"></a>

Thanks for the help...

g1smd

9:39 pm on Jan 18, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If it is going to read a database, you would be very much better off running the scripts on the server using PHP or ASP, not running that as JavaScript. JavaScript runs only in the user's web-browser.

Again, do search engines need to follow these links? If they do, be aware that search engines cannot run the JavaScript code, so again, you will need a PHP or ASP to dynamically build the HTML page on the server.