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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.