Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8777511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:17:38+00:00 2026-06-13T19:17:38+00:00

I want to use a jquery datepicker in a dialog box. The datepicker should

  • 0

I want to use a jquery datepicker in a dialog box. The datepicker should be triggered on focus (the default). Since the textbox is the first field on the dialog, it automatically has the focus. This has the unwanted effect of opening the datepicker when the dialog is opened first.

I have tried many different things such as setting the focus to a dummy href, calling datepicker(‘close’) after the dialog opens, setting the showOn to ‘button’, then changing to ‘focus’ after the dialog opens but none work.

The datepicker should only be rendered when the textbox gains the focus, except for when the dialog opens first.

My snippet

$(function() {
    $('#btnDialog').click(function() {
        $('#myDate').datepicker({
            title: 'Test Dialog'
        });
        $('#myDialog').dialog();
    });
});​

JS Fiddle link: http://jsfiddle.net/UkTQ8/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:17:39+00:00Added an answer on June 13, 2026 at 7:17 pm

    Solution: Add a dummy text box before the date textbox.

    Demo: http://jsfiddle.net/UkTQ8/4/

    <div id="myDialog" title="Text Dialog">
    
    <input type="text" id="dummyDate" /> <!-- dummy textbox -->
    
    <p>The textbox below should show the datepicker on focus, except for when the dialog opens.</p>
    Enter date: <input type="text" id="myDate" />
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use datetime picker in 4 text box. JQuery datepicker for 4
I Download Jquery datepicker from http://jqueryui.com/demos/datepicker/ and use it,know I want to my calndar's
I want to use the Jquery datepicker. I've got it setup using an the
I want to use the jQuery UI Datepicker for the following scenario. The user
I want to use the jQuery default date picker , it's awesome, but I
i want to use jquery UI's datepicker to trigger a POST that would then
I want to use an image of a calendar to show/hide the jquery datepicker.
Possible Duplicate: How to use JQuery datepicker and timepicker together I want to integrate
I use a jquery datepicker in my ASP.NEt Application and I want if the
How do I use the jQuery Datepicker with a textbox input: $(#my_txtbox).datepicker({ // options

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.