jQuery.ptTimeSelect v0.8.0
jQuery.ptTimeSelect is a jQuery plugin for usage on input fields that displays a popup widget allowing a user to define a time, which is written back to an input field.
Paul Tavares, http://www.purtuga.com
http://pttimeselect.sourceforge.net
Copyright (c) 2007-2012 Paul T. http://www.purtuga.com
Licensed under the same terms as jQuery:
User can pick whichever one applies best for their project and does not have to contact me.
jQuery.ptTimeSelect includes the following 2 files that must be deployed on the webserver and included in the display page:
Both of these files are included in the zip file under the src folder.
jQuery.ptTimeSelect plugin has the following prerequisites:
jQuery.ptTimeSelect plugin should be included in the head section of the html page, after the entries for jQuery and jQuery UI Style sheet as follows:
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.22/themes/redmond/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="jquery.ptTimeSelect.css" />
<script type="text/javascript" src="jquery.ptTimeSelect.js"></script>
</head>
jQuery.ptTimeSelect is called agaist input fields to attach a Time Select widget to each matched element. Each element, when focused upon, will display a time selection popoup where the user can define a time.
<input name="time" value="" />
<script type="text/javascript">
$(document).ready(function(){
$('input[name="time"]').ptTimeSelect();
});
</script>
The plugin accepts only one input parameter; a javascript object with the list of options. All options are optional. See below for a list of supported options
$('input[name="time"]').ptTimeSelect({
hoursLabel: 'HRS'
});
$('input[name="time"]')
.ptTimeSelect({
containerClass: undefined,
containerWidth: undefined,
hoursLabel: 'Hour',
minutesLabel: 'Minutes',
setButtonLabel: 'Set',
popupImage: undefined,
onFocusDisplay: true,
zIndex: 10,
onBeforeShow: undefined,
onClose: undefined
});
Function will return a jQuery object with the input selection, thus maintaining jQuery's chainable nature.
<input name="time" value="" style="display:none;" />
<script type="text/javascript">
$(document).ready(function(){
$('input[name="time"]')
.ptTimeSelect({
zIndex: 100,
onBeforeShow: function(input, widget){
// do something before the widget is made visible.
}
})
.show();
});
</script>
_BUILD_INCLUDE_DOCUMENTATION_