Function triggering early

前端 未结 2 1160
独厮守ぢ
独厮守ぢ 2020-12-12 03:44

I am trying to attempt to call back a value from a function, however, the call back is always undefined because the jQuery Date Picker never has a chance to set the var sdat

相关标签:
2条回答
  • 2020-12-12 04:22

    You aren't setting sdate at all. I think perhaps you meant to do sdate = select_date();?

    0 讨论(0)
  • 2020-12-12 04:29

    What does this do for you?

    $('#d1').datepicker({
            onSelect: function() {
               sdate = $(this).val(); 
              //set value to the global variable (although not the best approach)
                $("#dd").dialog("close");
            }
     });
    
    0 讨论(0)
提交回复
热议问题