User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 391,574 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,828 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 514 | Replies: 2
Reply
Join Date: Aug 2008
Posts: 1
Reputation: sujithkumar is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
sujithkumar sujithkumar is offline Offline
Newbie Poster

javascript date validation

  #1  
19 Days Ago
i have one date field i want to validate that field

that date should not be less that current date
if it is there show alert box
pls tell solution for this
With Regards,
SUJITH KUMAR G
Software Engineer,
Srishti Software Applications Pvt Ltd,
Mob: 09886101203
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2008
Location: Hyderabad,India.
Posts: 522
Reputation: Shanti Chepuru is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 53
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Posting Pro

Re: javascript date validation

  #2  
19 Days Ago
helloo try this..
  1. <script>
  2. function ValidateDate(CtrlSDate,CtrlEDate)
  3. {
  4. var SDate = document.getElementById(CtrlSDate).value;
  5. var calendarDate = getCalendarDate();
  6.  
  7.  
  8. var alertReason1 = 'End Date must be greater than or equal to Start Date.'
  9.  
  10. var endDate = new Date(calendarDate);
  11. var startDate= new Date(SDate);
  12.  
  13. if(SDate != '' && EDate != '' && startDate > endDate)
  14. {
  15. alert(alertReason1);
  16. document.getElementById(CtrlEDate).value = "";
  17. return false;
  18. }
  19.  
  20. }
  21. </script>
Last edited by Shanti Chepuru : 19 Days Ago at 6:46 am.
Champions Are Not SuperNatural,They Just Fought For One More Second When Every One Else Quit...Some times That One Second Of Effort Gives You The VICTORY...
Reply With Quote  
Join Date: Aug 2008
Posts: 1
Reputation: mohandotnet is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
mohandotnet mohandotnet is offline Offline
Newbie Poster

Re: javascript date validation

  #3  
16 Days Ago
Incase if user select from date as 10/7/2008 and to data as 15/6/2008 it is not validating the date.
Last edited by mohandotnet : 16 Days Ago at 3:20 am.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 10:31 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC