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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:39:54+00:00 2026-05-23T00:39:54+00:00

Alright, so I’m trying to switch over from having to enter a manual date

  • 0

Alright, so I’m trying to switch over from having to enter a manual date and time to using jquery to select the date and time.

I didnt think it would be too hard.

My View:

<%= Html.LabelFor(x => x.DDate) %>       
<%= Html.EditorFor(x => x.DDate) %>
<%= Html.ValidationMessageFor(x => x.DDate)%> <br />

My Site.Master(I’m also using this: http://trentrichardson.com/examples/timepicker/):

<script type="text/javascript" src="/Content/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="/Content/jquery-ui-1.8.6.custom.min.js"></script>
<script type="text/javascript" src="/Content/jquery-ui-timepicker-addon.js"></script>
<script  type="text/javascript">
        $('.dp').datetimepicker({
            ampm: true
        }); 
</script>

DateTime.ascx:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.DateTime?>" %>  
<%= Html.TextBox("",  String.Format("{0:MM-dd-yyyy}", Model.HasValue ? Model : DateTime.Today), new { @class = "dp"})%>  

Now I know somethings working right becuase when I load the page, there is a date preset with today’s date.

However, when I click the textbox, NOTHING shows up.

Does anyone have an ideas what I’m doing wrong?

  • 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-23T00:39:55+00:00Added an answer on May 23, 2026 at 12:39 am

    Try waiting for the document to be ready before manipulating it, otherwise at the time you execute your $('.dp') selector there is no corresponding elements loaded yet:

    <script type="text/javascript">
        $(function() {
            $('.dp').datetimepicker({
                ampm: true
            }); 
        });
    </script>
    

    Another possibility is to move this script at the end of your document (just before the closing </body>). This way you no longer need to wrap it in a document.ready handler.

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

Sidebar

Related Questions

Alright, here I am again trying to write code from scratch and I can't
Alright so using Python with windows I am trying to run a batch command
Alright, I'm trying to use the basic document.getElementsByTagName function, but each time I do,
Alright I created some custom classes for my project sourced from this tutorial ,
Alright I'm pretty new to programming and stuff and I'm now trying to code
Alright I am practicing using cURL to login to different webservices. For this pariticular
Alright, so I've been trying to implement a simple binary search tree that uses
Alright when I do the code: <script type = text/javascript > document.write((new Date).getTime()); </script>
Alright, here's an odd one from an MS Access database I'm running. I have
Alright, I'm injecting some code into another process using the CreateRemoteThread/LoadLibrary trick. I end

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.