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 1061003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:24:46+00:00 2026-05-16T18:24:46+00:00

Coding with ASP.NET 3.5 C#, jquery.1.4.2, jquery-ui-1.8.2 My textbox is in fourth asp:View of

  • 0

Coding with ASP.NET 3.5 C#, jquery.1.4.2, jquery-ui-1.8.2

My textbox is in fourth asp:View of an asp:MultiView which is not active on PageLoad.
My Page is also a content page with a master page. The textbox is created like

<asp:TextBox ID="txtStartDate" runat="server" 
        CssClass="datePicker" 
        MaxLength="20" 
        ReadOnly="true" 
        Width="70px" />

The datepicker is called like

$(document).ready(function () {
    $('.datePicker').live('click', function () {
        $(this).datepicker({ 
            showOn: 'focus',
            changeMonth: true,
            dateFormat: 'dd/mm/yy',
            minDate: '+0d',
            maxDate: '+1y'
            });
    });
});

I am not able to get the datepicker on the first click of the textbox.
What is wrong with this code?

  • 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-16T18:24:47+00:00Added an answer on May 16, 2026 at 6:24 pm

    It’s not showing the first time because the focus event has already fired, so you need to trigger it again so the focus fires and the datepicker shows, like this:

    $(document).ready(function () {
        $('.datePicker').live('click', function () {
            $(this).datepicker({ 
                showOn: 'focus',
                changeMonth: true,
                dateFormat: 'dd/mm/yy',
                minDate: '+0d',
                maxDate: '+1y'
            }).focus();           //add this
        });
    });
    

    You can give it a try here. Calling .focus() will fire the event once more, causing the datepicker handler on the event to fire, and it’ll show, even the first click.

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

Sidebar

Related Questions

Coding Platform ASP.NET 4.0 WebForms on IIS7.5 If I request a page blahblah.aspx which
I'm coding an application with JQuery Mobile and ASP.NET. I have a page with
When coding an Asp.Net page, you generally add a runat attribute in the aspx:
I am novice to jquery and asp.net. I am using the following coding to
Coding in ASP.NET 4.0 / javascript/ jQuery/ WebServices The Scenario I have an analytics
I've got a simple textbox on my asp.net page wrapped around an updatepanel: <asp:UpdatePanel
I am using visual studio 2008 coding asp.net.vb I have 20 images on my
The coding is in ASP.NET 3.5. Here is the scenario. I am modifying a
How do I even begin coding authentication using ASP.NET Web API so it is
i want to ask a question about how to do paging in ASP.net coding

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.