dadamssg87 Posted May 22, 2011 Share Posted May 22, 2011 I'm developing with php and trying to work jquery's datepicker into my app. I'm trying to display a datepicker that's tied to a particular input field. I have the following code. The problem is that the first time i click on the input, nothing happens. Only when I unfocus and then reclick on it will it display the picker like i want. How do i get it to display the datepicker on the first click? <script> function open_picker(X) { $( X ).datepicker({ autoSize: true, showOtherMonths: true, selectOtherMonths: true }); }; </script> <?php $datepickerid = "datepicker" ?> <input id='<?php echo $datepickerid; ?>' onClick='open_picker("<?php echo "#".$datepickerid; ?>");' type='text' value='05/21/2011' size='10'> Link to comment https://forums.phpfreaks.com/topic/237142-php-and-jquery-datepicker-problem/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.