datepicker JQuery function in modal window
I'm trying to add datepicker in my modal window, but I had no success so far.
<script src="/js/jquery-1.6.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#date_start").datepicker({ showOn: 'button', buttonImageOnly: true, buttonImage: '/images/pick_date.png' });
});
</script>
<div><?php echo $this->开发者_StackOverflow社区;form->date_start ?></div> //this form element has id="date_start"
Any ideas?
nothing, it's like datepicker doesn't exist
Then probably your code runs before the DOM is ready. Fix things so it runs after the DOM is ready. jQuery can help you do this.
精彩评论