TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Test
NA
58
51k
unable to perform date validation using jquery
Sep 20 2019 1:09 AM
I have a text box where i will be giving the date in text box and i need to compare that given date in text box with todays date it working for past date which is the expected reult but if i am giving future date its still showing me the validation instead of inserting the date.How can i resolve this issue
Below is my code that i have used
var currentdate = new Date();
var todayDate = (currentdate.getMonth() + 1) + "/" + currentdate.getDate() + "/" + currentdate.getFullYear();
if ($("#txtDate").val() < todayDate) //txtdate is 10/20/2019 and today date is 09/20/2019 but still i am getting validation which should not happen
{
MessageDisp('divAlertMessage', "Date Cannot Be Less Than Today's Date.", 'Error');
return false;
}
Reply
Answers (
5
)
Display all employee whether their Datetime(A_Date) exit or
Technologies need to know