 |
|
มาเริ่มต้นหัดเขียน datepicker ตัวเล็กๆ ก่อนไหมครับ
Code (PHP)
<?php
if(isset($_REQUEST['dte'])){
echo 'date = ' . $_REQUEST['dte'];
exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" href="../jquery-ui-1.11.1/jquery-ui.min.css" />
<script src="../jquery-2.1.1.min.js"></script>
<script src="../jquery-ui-1.11.1/jquery-ui.min.js"></script>
<script>
$(document).ready(function(e) {
$('#dte').datepicker({
dateFormat: 'dd-M-yy',
minDate: '1-Jan-2015',
maxDate: '28-Feb-2015',
dayNamesMin: ['อา', 'จ', 'อ', 'พ', 'พฤ', 'ศ', 'ส'],
monthNames: ['มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน',
'กรกฏาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'],
});
});
</script>
<style type="text/css">
.ui-datepicker { background: #333; border: 1px solid #555; color: #EEE; font-size:10px; }
.ui-widget-header{ background-color: #999; background-image: none; border: 1px solid #555; color: Black; }
</style>
</head>
<body>
<form>
<input id="dte" name="dte" type="text" />
<button>save</button>
</form>
</body>
</html>
ปล. file ที่จำเป็นหาโหลดได้จาก google เลยนะครับ
<link rel="stylesheet" href="../jquery-ui-1.11.1/jquery-ui.min.css" />
<script src="../jquery-2.1.1.min.js"></script>
<script src="../jquery-ui-1.11.1/jquery-ui.min.js"></script>
|
ประวัติการแก้ไข 2015-02-07 15:18:31
 |
 |
 |
 |
Date :
2015-02-07 15:14:07 |
By :
Chaidhanan |
|
 |
 |
 |
 |
|
|
 |