ATimePicker allows your user to
- Pickup an hour and update a field
- Pickup a delay and update on or more field
The hour format is fully parametrable. The applet can update a field in the page or call an URL with the hour in parameter.
Look at example 3 to see the hours using the am/pm format.
Example 1 : Pick up an hour
Example 2 : Pick up a delay and update 3 fields
Example 3 : Pick up a delay and update 1 field, am/pm format
Example 4 : Calling a javascript function
Download timepick.zip
HTML code
<APPLET CODE="ATimePicker.class" ARCHIVE="ATimePicker.jar"
WIDTH=100 HEIGHT=260 MAYSCRIPT>
<PARAM name="form" VALUE="tform">
<PARAM name="field1" VALUE="tfield">
<PARAM name="format1" VALUE="H:M">
<PARAM name="selint" VALUE="10">
HTML code
<APPLET CODE="ATimePicker.class" ARCHIVE="ATimePicker.jar"
WIDTH=100 HEIGHT=240 MAYSCRIPT>
<PARAM NAME="form" VALUE="tform1">
<PARAM NAME="multi" VALUE="o">
<PARAM NAME="field1" VALUE="tfield11">
<PARAM NAME="format1" VALUE="H:M">
<PARAM NAME="field2" VALUE="tfield12">
<PARAM NAME="format2" VALUE="h:m">
<PARAM NAME="field3" VALUE="tfield13">
<PARAM NAME="format3" VALUE="D:d">
HTML code
<APPLET CODE="ATimePicker.class" ARCHIVE="ATimePicker.jar"
WIDTH=100 HEIGHT=240 MAYSCRIPT>
<PARAM NAME="form" VALUE="tform2">
<PARAM NAME="multi" VALUE="o">
<PARAM NAME="field1" VALUE="tfield">
<PARAM NAME="format1" VALUE="H:MP - h:mp ( D:d )">
<PARAM NAME="h1" VALUE="9">
<PARAM NAME="hmin" VALUE="8">
<PARAM NAME="hmax" VALUE="20">
<PARAM NAME="ampm" VALUE="y">
<PARAM name="bgcolor" VALUE="ffce63">
HTML code
<SCRIPT LANGUAGE="JavaScript">
<!--
function alertTime()
<
alert("Hour = "+document.timepicker.stringFormat('H')+
", minute="+document.timepicker.stringFormat('M'));
}
//-->
</SCRIPT>
<APPLET CODE="ATimePicker.class" ARCHIVE="ATimePicker.jar" name=timepicker"
WIDTH=100 HEIGHT=200 MAYSCRIPT>
<PARAM name="nowatch" VALUE="">
<PARAM name="selint" VALUE="10">
<PARAM name="h1" VALUE="9">
<PARAM name="hmin" VALUE="8">
<PARAM name="hmax" VALUE="20">
<PARAM name="ampm" VALUE="y">
<PARAM name="bgcolor" VALUE="ffce63">
<param name="jvf" value="alertTime()">
</APPLET>
| multi | When this parameter is present, ATimePicker allows to pickup a delay, when it is absent, ATimePicker allows to pick up a hour. |
| ampm | When this parameter is present, the hours are displayed from 0:00am to 11:00pm instead of 0:00 to 24:00 |
| form | Form name |
| field1..field9 | Field to update. Up to 9 fields |
| format1..format9 | Field to update format.
Each field mut ABSOLUTELY have a format. The format is a string. Theses characters are translated :
| H | Begin hour |
| M | Minutes of the begin hour |
| P | Period ( am or PM ) of the begin hour |
| h | End hour |
| m | Minutes of the end hour |
| p | Period ( am or PM ) of the end hour |
| D | Number of hour in the delay |
| d | Number of minutes in the delay |
The other characters are displayed as is.
|
| nowatch | When this parameter is present, the little watch doesn't appear. |
| URL | When this parameter is present, the parameter field1 must contain an URL. This URL is called with the hour in parameter, the format of the hour is given by format1
For exemple
<PARAM name="field1" VALUE="http://www.myserver.com/myasp">
<PARAM name="format1" VALUE="H:M">
If the user click on 8h30, the url http://www.myserver.com/myasp?8:30 is called.
|
| selint | By default, the user can choose time from 15 minutes to 15 minutes. This parameter allows to change the interval in minutes that the user can select. |
| hmin | Minimum hour the picker can display. Default is 0 |
| hmax | Maximum hour the picker can display. Default is 24 |
| h1 | First hour initialy displayed by the picker. Must be greater or equal to hmin. Default is 8 |
| h2 | Last hour initialy displayed by the picker. Must be less or equal to hmax. |
| bgcolor | Background color using RGB format. |
| jvf | Name of the javascript function to call. Don't forget the (). See example 4
The applet has a usefull method stringFormat to peek the time picker values
This function wait for a string as parameter. This string has the same format has the parameters format1 to format9
Example
- document.timepicker.stringFormat('H') return the first hour selected
- document.timepicker.stringFormat('M') return the minutes first hour selected
- document.timepicker.stringFormat('H:M-h:m') return a string like 01:30-03:00
|