ช่วยดู Jquery ให้ผมหน่อยครับ

เริ่มโดย deknakhon, 17 กันยายน 2011, 21:55:40

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

deknakhon

ปัญหาตอนนี้คือเลือกวันที่แล้วต้อง Click อีกครั้งถึงข้อมูลจะแสดงออกมา และ พอ click เปลี่ยนวันที่ ก็ไม่ Refresh ข้อมูลให้




$(function(){

$("#ARRIVE" ).datepicker({
            dateFormat: 'yy-mm-dd',
    minDate: +1,
    numberOfMonths: 2,
    changeMonth: true,
    changeYear: true,
            showOn: "both",
    showButtonPanel: true
           
});
       $("#ARRIVE").click(function () {
$('#msg').html($('#ARRIVE').val());

    });
       
     
        $("#DEPART").datepicker({
         dateFormat: 'yy-mm-dd',
         minDate: +2,
         numberOfMonths: 2,
changeMonth: true,
changeYear: true,
showOn: "both",
         showButtonPanel: true
});

        $("#DEPART").click(function () {
$('#msg1').html($('[NAME=DEPARTCHK]').val());

    });
});



ต้องการแสดงข้อมูลออกมามาหลักจากเลือกวันที่แล้ว

<h4>DEPART value : <label id="msg"></label></h4>
<h4>ARRIVE value : <label id="msg1"></label></h4>




รับพัฒนาโปรแกรม PHP Mysql
รับออกแบบระบบโปรแกรม
รับวางระบบเครือข่ายคอมพิวเตอร์

marus

ลองเปลี่ยนจาก click เป็น change ดู

bonshington


iCeEffecT

#3
$(function(){

$("#ARRIVE" ).datepicker({
            dateFormat: 'yy-mm-dd',
    minDate: +1,
    numberOfMonths: 2,
    changeMonth: true,
    changeYear: true,
            showOn: "both",
    showButtonPanel: true,
    onSelect: function(dateStr){
$('#msg').html(dateStr);
    }
});
       
        $("#DEPART").datepicker({
         dateFormat: 'yy-mm-dd',
         minDate: +2,
         numberOfMonths: 2,
changeMonth: true,
changeYear: true,
showOn: "both",
         showButtonPanel: true,
onSelect: function(dateStr){
             $('#msg1').html(dateStr);
}
});

});

:wanwan020: