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, I'm trying to use the basic document.getElementsByTagName function, but each time I do,
Alright so I have the query (SELECT * FROM jokes WHERE flags < 5
Alright. So I figure it's about time I get into unit testing, since everyone's
Alright, I'm trying to read a comma delimited file and then put that into
Alright, after doing a ton of research and trying almost every managed CPP Redist
Alright, quick question. A server is running in Eastern Time. PHP program needs to
Alright. I have a query that looks like this: SELECT SUM(`order_items`.`quantity`) as `count`, `menu_items`.`name`
Alright, so I have a query that looks like this: SELECT `orders`.*, GROUP_CONCAT( CONCAT(
Alright, here's what I'm trying to do. I'm attempting to write a quick build
Alright, here is my problem i'm trying to solve. I have an index page

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.