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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:07:26+00:00 2026-06-05T23:07:26+00:00

I have users selecting a DateTime using a caldendar/clock popup that allows them to

  • 0

I have users selecting a DateTime using a caldendar/clock popup that allows them to make a selection. However, if they were to go in and edit the date to read something like: 6/12/201 10:36:47 AM instead of 6/12/2012 10:36:47 AM my Action gets past the ModelState.IsValid check and I get an error when the Controller attempts to save the object to the database (rightly so).

How do I properly validate DateTime in this situation? (I want to prevent a user from even being able to ‘submit’ the form if the datetime is not properly formatted)

Note: I currently have in place jquery.validate and typically (fields not DateTime) I use @Html.ValidationMessageFor(model => model.Field) – This does not appear to do anything for my current DateTime fields when they are formatted inappropriately.

  • 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-05T23:07:28+00:00Added an answer on June 5, 2026 at 11:07 pm

    you can simply add date client side validator for you DateTime field using snipet like that:

            $(element).rules('add', {
            date: true,
        });
    

    where “element” is your input for DateTime field.

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

Sidebar

Related Questions

I have a PHP script that allows users to enter grades by selecting a
I have an HTML5 application that allows users to drag-n-drop an image to a
I have a dropdownlist box, from which a user makes a selection. However, I
I have users that have several objects and can upload images for those objects.
I have users who write articles and when they leave there computer for a
I have an aspx calendar that works fine in IE, however, in FF, the
I have an app where users can send emails to other users by selecting
I have a listbox that you can select users in. To the left of
I have a program that uses OpenGL combined with Cocoa and Python using PyObjC.
I have to display a form and the users must decide on selecting just

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.