Simple Date Picker With Jquery UI

heheh… Beberapa hari ini ane sempet bingung.. coz jujur aja ane paling lemah di Jquery… waduh…. tapi anyway.. kalo kita mau usaha pasti ada jalan… perlahan tapi pasti ane mulai mengisi kembali hidup ini.. (lah.. jadi kemana tau…  :) ) oke deh langsung aja… berikut ini contoh penggunaan sederhana Date Picker menggunakan Jquery… UI…

<html>
<head>
<title>Simple Date Picker</title>
<link rel=”stylesheet” href=”themes/base/jquery.ui.all.css”>
<script src=”jquery-1.6.2.js”></script>
<script src=”ui/jquery.ui.core.js”></script>
<script src=”ui/jquery.ui.widget.js”></script>
<script src=”ui/jquery.ui.datepicker.js”></script>
<script type=”text/javascript”>

var i = 0;
$(function(){
$(“#datepicker”).datepicker({
showOn : “button”,
buttonImage : “images/calendar.gif”,
buttonImageOnly : true
});

});

$(document).ready(function(){
$(“#buttonAdd”).click(function(){
i++;
$(“#myTable”).append(‘<tr>’+
‘<td>’+
‘<input type=”text” name=”append_’+i+'” id=”append_’+i+'”/>’+
‘</td>’+
‘</tr>’);

$(“#append_”+i).datepicker({
showOn : “button”,
buttonImage : “images/calendar.gif”,
buttonImageOnly : true
});
});
});

</script>
</head>
<body>
<input type=”text” id=”datepicker”/>
<input type=”button” id=”buttonAdd” value=”Add” />
<table id=”myTable”>

</table>
</body>
</html>

 

Hasilnya :

 

sorry banget berantakan …. Good Luck !

2 thoughts on “Simple Date Picker With Jquery UI

  1. whuahaa.. mantaap.. kebetulan pas lagi nyari niih. Thanks yaa… :D . file jquery.ui.all.css, jquery.ui.core.js, jquery.ui.widget.js, dan jquery.ui.datepicker.js disertakan juga doonk.. >.< biar bisa buat latian.
    Keep in post.. ^^

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>