Jump to content

php and jquery datepicker problem


dadamssg87

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.