Feature
Showing posts with label jquery. Show all posts
Showing posts with label jquery. Show all posts
Tuesday, August 5, 2014
Thursday, April 11, 2013
jquery check all checkboxes
![]() |
| ilustrasi tabel dengan banyak data |
Thursday, November 22, 2012
jquery combobox with json
ok, lets start how to make jquery combobox and json without plugin to
make fastest process, it seems i have to learn a new thing each time i
start project. anyway, i’m trying to learn before but it fail cause i’m
so lowly about understanding jquery function and implementation.
Now, the basic things you want to do with said select statement:
1. Get the value of the selected item in the province combobox.
2. clear the value option in the region combobox.
3. add new value by the province
and now we will to make combobox about province and region,, in the indonesia we have many province that have many regions too. and we have a combobox id
member_province data like this :
and how jquery to load json data ???
jquery have a function to read json data : getJSON
and when we select yogyakarta province we have a result json like this :
Now, the basic things you want to do with said select statement:
1. Get the value of the selected item in the province combobox.
2. clear the value option in the region combobox.
3. add new value by the province
and now we will to make combobox about province and region,, in the indonesia we have many province that have many regions too. and we have a combobox id
<select name=”member_province” id=”member_province”>
<option selected=”selected” value=”34″>-</option>
<option value=”5″>Yogyakarta</option>
</select>
and how jquery to load json data ???
jquery have a function to read json data : getJSON
$(document).ready(function(){
$(“#member_province”).click(function(event){
if($(this).val()!=”){
$(“#member_region”).empty();
$.getJSON(“http://toespconer.wordpress.com/regionbyprovince/”+$(this).val(), function(data) {
$.each(data, function(key, val) {
$(“#member_region”).append(” + val.region_name + ”);
});
});
}
});
});
and when we select yogyakarta province we have a result json like this :
[
{"region_id":"3","region_name":"Kota Yogyakarta","province_id":"5","region_date":"2012-05-07 09:22:47"},{"region_id":"4","region_name":"Sleman","province_id":"5","region_date":"2012-05-07 09:22:47"}]
and combobox region will automaticly change the value :Tuesday, November 20, 2012
jquery restrict datepicker - add minDate according to previous calendar
| ini screenshoot salah satu halaman dari simpas-3.0 |
untuk jquery dan jquery-ui bisa download. search digoogle aj kalo belum tau.
<script>
$(document).ready(function(){
$( "#tgl_pinjam" ).datepicker({
dateFormat: "dd-mm-yy",
onSelect: function (dateValue, inst) {
var d = $.datepicker.parseDate('dd-mm-yy', dateValue);
d.setDate(d.getDate() + 1); // Add three days
$("#tgl_kembali").datepicker("option", "minDate", d)
}
});
$( "#tgl_kembali" ).datepicker({
defaultDate: "+1d",
dateFormat: "dd-mm-yy"
});
});
</script>
asal pencerahan : http://stackoverflow.com/questions/6018990/jquery-datepicker-limit-mindate-according-to-previous-calendar
Subscribe to:
Posts (Atom)





