jquery plugin datepicker and timepicker

蓟雪峰
2023-12-01
download jquery ui - core, widget, mouse, slider, datepicker and
jquery.timepicker.js v0.9.5 Trent Richardson


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Reservations</title>
<link rel="stylesheet" type="text/css" href="css/custom-theme/jquery-ui-1.8.13.custom.css" />
</head>

<body>

<form action="mail.php" method="post" class="validate">
<fieldset>
<p>
<label for="date">Date / Time *</label><input type="text" name="date" id="date" /> /
<input type="text" name="time" id="time" />
</p>

<p><input type="submit" value="Submit" id="submit" class="submit" /></p>

</fieldset>
</form>


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.13.custom.min.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
$(function(){
$('#date').datepicker({
dateFormat: 'dd-mm-yy DD',
// within 7 days in the future
minDate: 0,
maxDate: '+6',
// click to insert today to avoid trigger blur required validation error
beforeShow: function(input, inst) {
if ($(this).val()=='') {
// avoid can't change value bug
$(this).val(' ');
$(this).val($.datepicker.formatDate('dd-mm-yy DD', $(this).datepicker("getDate")));
}
}
});
$('#time').timepicker({
// set range, grid and step
hourMin: 11,
hourMax: 20,
hourGrid: 2,
minuteGrid: 10,
stepMinute: 10
});
})
/* ]]> */
</script>
</body>
</html>
 类似资料:

相关阅读

相关文章

相关问答