Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q814 Is it possible to accept the year, month and activity from a form an then load the relevant index page page from an activity subdirectory within a month subdirectory with a year subdirectory, e.g. 1996/09/running/index.htm?

irt.org | Knowledge Base | JavaScript | Date | Q814 [ previous next ]

Q814 Is it possible to accept the year, month and activity from a form an then load the relevant index page page from an activity subdirectory within a month subdirectory with a year subdirectory, e.g. 1996/09/running/index.htm?

Try the following:

<SCRIPT LANGUAGE="JavaScript"><!--
function getPage(what) {
    var year = what.year.options[what.year.selectedIndex].text;
    var month = what.month.options[what.month.selectedIndex].value;
    var activity = what.activity.options[what.activity.selectedIndex].value;
    location.href = year + '/' + month + '/' + activity + '/index.htm';
}
//--></SCRIPT>

<FORM>
<SELECT NAME="year">
<OPTION>1996
<OPTION>1997
<OPTION>1998
<OPTION>1999
<OPTION>2000
</SELECT>

<SELECT NAME="month">
<OPTION VALUE="01">January
<OPTION VALUE="02">February
<OPTION VALUE="03">March
<OPTION VALUE="04">April
<OPTION VALUE="05">May
<OPTION VALUE="06">June
<OPTION VALUE="07">July
<OPTION VALUE="08">August
<OPTION VALUE="09">September
<OPTION VALUE="10">October
<OPTION VALUE="11">November
<OPTION VALUE="12">December
</SELECT>

<SELECT NAME="activity">
<OPTION VALUE="running">Running
<OPTION VALUE="walking">Walking
<OPTION VALUE="swimming">Swimming
<OPTION VALUE="cycling">Cycling
</SELECT>

<INPUT TYPE="BUTTON" VALUE="Submit" onClick="getPage(this.form)">
</FORM>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 6th July 2009. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2009 irt.org, All Rights Reserved.