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

  • Home
  • SEARCH
  • 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 7086797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:35:41+00:00 2026-05-28T07:35:41+00:00

I created a modal form/window using with the code: $(function () { var widthLen

  • 0

I created a modal form/window using with the code:

    $(function () {
        var widthLen = window.screen.width - 10;
        var heightLen = window.screen.height - 120;
        $("#dialogOperation").dialog({
            width: widthLen,
            height: heightLen,
            closeOnEscape: true,
            modal: true,
            close: function () {
                window.location.href = "OperationMenu.aspx" 
            } 
        });
    });

with a textbox that has date picker attached to it and buttons in it. Everything works fine except for a little issue – the date picker calendar is always displaying everytime there is a postback. After every control event the calendar is appears.

What I want to happen is to show the calendar only when I click the textbox which is commonly happening in the forms that are not modal dialog.

When I tried hiding the datepicker using:

    $(document).ready(function () {
        $('#txtDate').datepicker('hide');
    });

I was only unable to show the calendar anymore even though I call it on a text focus:

    $("#txtDate").focus(function () {
        $('#txtDate').datepicker();
    }).blur(function() {
        $('#txtDate').datepicker('hide');
    });

I have also tried putting z-index: 1003 inside the jquery css but I am still not having much luck.

.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; z-index: 1003; }

Anyone who can help me resolve this issue would be greatly appreciated.

Thanks in advance!!

Regards,
Harland

  • 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-05-28T07:35:41+00:00Added an answer on May 28, 2026 at 7:35 am

    Either you can use the option showOn
    http://docs.jquery.com/UI/Datepicker#option-showOn

    Or disable datepicker first and use the open event of dialog to enable it.Disable when dialog is closed.

    open: function(){
        $('#txtDate').datepicker('enable');
    
    },
    close: function() {
        $('#txtDate').datepicker('disable');
    }
    

    demo: http://jsfiddle.net/diode/Xawe2/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a modal dialog that is created with the following: procedure TFormCompose.createParams(var Params:
I'm using Lightwindow v2 in a Symfony project to create a modal window (
I use this call to create modal window using simplemodal ( http://www.ericmmartin.com/projects/simplemodal/ ): $.get(openform/,
Using the code found here: How to popup a jquery window to play youtube
I am using modalbox for a modal window to submit forms that I learned
I'm using jQuery UI Selectmenu to style a form's dropdowns. I've created an example
if i have created a view model and have a partial form that is
Does anybody know how I can close all modal dialogs created by Dojo ?
I want to be able to create modal dialogs, with, for example close: function()
i created a model object in PHP class User { public $title; public function

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.