I have a form that uses jQuery’s datepicker(). That works fine.
Now, I’m adding in inline editing capabilities for my users. However, the datepicker() isn’t returning a value to the editable field.
The script:
<script>
$(function() {
$("td[id^=rowDate]").click(function() {
$(this).html('<input type="text" name="editStartDate" value="" class="editStartDate" />');
$(".editStartDate").datepicker();
});
});
</script>
I’m not sure if it matters, but I also call the datepicker() after this function to handle a separate task:
<script> $(".startDate, .endDate").datepicker(); </script>
I want the datepicker() to return a new value to #editStartDate What am I doing wrong?
clean approach: