we do still use traxis and just today i noticed that the date filter updates itself automatically....
i would assume this would have to be done on a form as an ssi include on the order form...
any ideas?
many thanks
<form action="http://www.example.com/cgi-bin/process-form.cgi">
Date:<entry type="text" name="date"
value="<!--#echo var="DATE_LOCAL" -->"><br>
Name:<entry type="text" name="name"><br>
<entry type="submit" value="Ok">
</form>
This works for a form loaded from a static file (even if it is included by another mod_include directive).
If your form is created dynamically by a CGI script, then the programming language used will offer more convenient functionality to the same effect.
please follow this link
[webshop101.com...]
notice in the lower half of the page in the green shaded "time Range Filter"
see how todays is displayed by default???
this is a feature i would like to add to static html order forms ---
we have flower shop and this would be a nifty feature to add for our select delivery day/month drop down menues
how could i do this???
many thanks for your thoughts
For plain static pages the only way is javascript.
put this code in your page where you want the data to display.
------------------------
<script language="JavaScript">
<!--
//------------DATE AND TIME
today = new Date()
TimeHrs = today.getHours()
TimeMin = today.getMinutes()
DateMth = today.getMonth()+1
DateDate = today.getDate()
DateYear = today.getYear()
DateDy = today.getDay()
if (TimeHrs > 12) {
TimeHrs = TimeHrs - 12
if (TimeHrs == 12) {
AmPm = "am"
} else {
AmPm = "pm"
}
} else {
if (TimeHrs == 12) {
AmPm = "pm"
} else {
AmPm = "am"
}
}
if (TimeMin < 10) {
TimeMin = "0" + TimeMin
}
if (DateMth == 1) { DateMonth = "January "
} else if (DateMth == 2) { DateMonth = "February "
} else if (DateMth == 3) { DateMonth = "March "
} else if (DateMth == 4) { DateMonth = "April "
} else if (DateMth == 5) { DateMonth = "May "
} else if (DateMth == 6) { DateMonth = "June "
} else if (DateMth == 7) { DateMonth = "July "
} else if (DateMth == 8) { DateMonth = "August "
} else if (DateMth == 9) { DateMonth = "September "
} else if (DateMth == 10) { DateMonth = "October "
} else if (DateMth == 11) { DateMonth = "November "
} else { DateMonth = "December "
}
if (DateDy == 0) { DateDay = "Sunday"
} else if (DateDy == 1) { DateDay = "Monday, "
} else if (DateDy == 2) { DateDay = "Tuesday, "
} else if (DateDy == 3) { DateDay = "Wednesday, "
} else if (DateDy == 4) { DateDay = "Thursday, "
} else if (DateDy == 5) { DateDay = "Friday, "
} else { DateDay = "Saturday"
}
brsr=navigator.appName
if (brsr=="Netscape") {
if (DateYear < 99) {
DateYear = DateYear + 2000
} else { DateYear = DateYear + 1900
}
}
document.write(DateDay + " " + DateMonth + DateDate + ", " + DateYear)
// -->
</script>
That leads me to a login page...
Anyway, if I understand you correctly, then you want the right item from a dropdown preselected, so that the user doesn't need to change it in the standard case. This is done by adding the selected="selected" attribute to one of the <option> tags within a <select>.
If you want to do this automatically within a static page, then you can fiddle with SSI if/endif clauses, comparing the date with a regular expression for each item:
<select name="weekday">
<option
<!--#if expr="$DATE_LOCAL = /Monday/" -->
selected="selected"<!--#endif -->>
Monday</option>
<option
<!--#if expr="$DATE_LOCAL = /Tuesday/" -->
selected="selected"<!--#endif -->>
Tuesday</option>
<option
<!--#if expr="$DATE_LOCAL = /Wednesday/" -->
selected="selected"<!--#endif -->>
Wednesday</option>
<option
<!--#if expr="$DATE_LOCAL = /Thursday/" -->
selected="selected"<!--#endif -->>
Thursday</option>
<option
<!--#if expr="$DATE_LOCAL = /Friday/" -->
selected="selected"<!--#endif -->>
Friday</option>
<option
<!--#if expr="$DATE_LOCAL = /Saturday/" -->
selected="selected"<!--#endif -->>
Saturday</option>
<option
<!--#if expr="$DATE_LOCAL = /Sunday/" -->
selected="selected"<!--#endif -->>
Sunday</option>
</select>
Doesn't look extremely elegant in the source, but it works... ;)
Care must be taken when crafting the regular expressions for numeric parts of the date string, to ensure that they really only match the part you want. Most likely this will be done by including leading/trailing spaces and other special characters.
Ah yes, and if you don't want to use the *.shtml extension (eg. if most of your pages use SSI anyway), then you can put this into the .htaccess in the same directory:
AddHandler server-parsed .html