|
|
|
ถามเรื่อง Datepicker Block Startdate ห้ามมากกว่า Enddate และ Endate ห้ามน้อยกว่า StartDate แบบหลาย Input ครับ |
|
|
|
|
|
|
|
Code (JavaScript)
for(x=0;x<form2.count_sel.value;x++){
var a = x;
var start_date_sel = "#start_date_sel";
var start_date_sel = start_date_sel+a;
var end_date_sel = "#end_date_sel";
var end_date_sel = end_date_sel+a;
var start_date_stopsale_sel = "#start_date_stopsale_sel";
var start_date_stopsale_sel = start_date_stopsale_sel+a;
var end_date_stopsale_sel = "#end_date_stopsale_sel";
var end_date_stopsale_sel = end_date_stopsale_sel+a;
$(start_date_sel).datepicker({
numberOfMonths: 1,
onSelect: function(selected) {
id = $(this).attr('id');
var lastChar = id.substr(id.length - 1);
var lastChar2 = "#end_date_sel"+lastChar;
$(lastChar2).datepicker("option","minDate", selected)
}
});
$(end_date_sel).datepicker({
numberOfMonths: 1,
onSelect: function(selected) {
id = $(this).attr('id');
var lastChar = id.substr(id.length - 1);
var lastChar2 = "#start_date_sel"+lastChar;
$(lastChar2).datepicker("option","maxDate", selected)
}
});
$(start_date_stopsale_sel).datepicker({
numberOfMonths: 1,
onSelect: function(selected) {
id = $(this).attr('id');
var lastChar = id.substr(id.length - 1);
var lastChar2 = "#end_date_stopsale_sel"+lastChar;
$(lastChar2).datepicker("option","minDate", selected)
}
});
$(end_date_stopsale_sel).datepicker({
numberOfMonths: 1,
onSelect: function(selected) {
id = $(this).attr('id');
var lastChar = id.substr(id.length - 1);
var lastChar2 = "#start_date_stopsale_sel"+lastChar;
$(lastChar2).datepicker("option","maxDate", selected)
}
});
}
ได้ล่ะครับ ปิดจ๊อบ
|
|
|
|
|
Date :
2015-02-10 15:09:00 |
By :
nut_ch31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jQuery UI Datepicker ปฏิทินวันที่ Calendar เลือกลงใน Textbox เลือกได้ทั้ง Date/Time
|
|
|
|
|
Date :
2015-02-10 16:56:13 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|