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'> Quote Link to comment https://forums.phpfreaks.com/topic/237142-php-and-jquery-datepicker-problem/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.