jquery - how to write a callback function, after the datapicker date selection? -


i using datapicker on field pop out calender. after selection of date using datapicker want execute callback function, in function want set selected date value another field.

this currrent code

<%= text_field_tag "from_date",date.today.beginning_of_month.strftime("%d-%b-%y") , :class=>"form-control from_picker", :id => "start",'data-behaviour' => 'datepicker',:placeholder =>"from" %>   <script type="text/javascript">   $.fn.datepicker.defaults.format = "dd-m-yyyy";    $(document).on("focus", "[data-behaviour~='datepicker']", function(e){     $(this).datepicker({"autoclose": true,                          onselect: function(selecteddate) {                            alert(selecteddate);                            var from_picker = $(".from_picker").val();                            $("#d_start").val(from_picker.tostring());                          }     });   }); </script>   <%= text_field_tag "set_date",date.today.beginning_of_month.strftime("%d-%b-%y") , :class=>"form-control", :id => "d_start",'data-behaviour' => 'datepicker',:placeholder =>"from" %> 

the datapicker working fine. able select date. callback not getting executed, because of unable set value other field.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

C#.NET Oracle.ManagedDataAccess ConfigSchema.xsd -