Membuat sebuah desain input tanggal menggunakan JQuery Datepicker.

Codenya seperti ini

<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8″ />
<title>jQuery UI Datepicker – Default functionality</title>
<link type=”text/css” href=”http://jqueryui.com/themes/base/jquery.ui.all.css” rel=”stylesheet” />
<script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js”></script>
<script type=”text/javascript” src=”http://jqueryui.com/ui/jquery.ui.core.js”></script>
<script type=”text/javascript” src=”http://jqueryui.com/ui/jquery.ui.widget.js”></script>
<script type=”text/javascript” src=”http://jqueryui.com/ui/jquery.ui.datepicker.js”></script>
<link type=”text/css” href=”http://jqueryui.com/demos/demos.css” rel=”stylesheet” />
<script type=”text/javascript”>
$(function() {
$(”#datepicker”).datepicker();
});
</script>
</head>
<body>
<div class=”demo”>
<p>Date: <input type=”text” id=”datepicker”></p>
</div><!– End demo –>
<div class=”demo-description”>
<p>The datepicker is tied to a standard form input field.  Focus on the input (click, or use the tab key) to open an interactive calendar in a small overlay.  Choose a date, click elsewhere on the page (blur the input), or hit the Esc key to close. If a date is chosen, feedback is shown as the input’s value.</p>
</div><!– End demo-description –>
</body>
</html>
Untuk CSS dan JSnya disini
<link type=”text/css” href=”http://jqueryui.com/themes/base/jquery.ui.all.css” rel=”stylesheet” />
<script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js”></script>
<script type=”text/javascript” src=”http://jqueryui.com/ui/jquery.ui.core.js”></script>
<script type=”text/javascript” src=”http://jqueryui.com/ui/jquery.ui.widget.js”></script>
<script type=”text/javascript” src=”http://jqueryui.com/ui/jquery.ui.datepicker.js”></script>
<link type=”text/css” href=”http://jqueryui.com/demos/demos.css” rel=”stylesheet” />
Untuk script inject INPUT Formnya disini
<script type=”text/javascript”>
$(function() {
$(”#datepicker”).datepicker();
});
</script>
Diisikan dengan id dari input box yang akan disipkan script Datepicker.

Posting Komentar

Konversi Kode
[Mulai Senin, 30 Januari 2012] Maaf, Jangan Masukkan Link Pada Komentar