Set Date (Date Picker) Value from ClientEvents
Hi... can anyone help me.
I just want to make automatically change a date (date-picker: tgl_perubahan) value to today when user change the price (harga_satuan) value.
This is my script on clientevents:
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
if(dd<10){dd='0'+dd} if(mm<10){mm='0'+mm} today = yyyy+'-'+mm+'-'+dd;
$(document.body).on('change keyup input', 'input[name="harga_satuan"]', function() {
$('#ctrl-tgl_perubahan').val(today);
});
Note :
#ctrl-tgl_perubahan : id of a date field
harga_satuan : name of a price field