Hi Frendz,
I have two text fields 'from time' and 'to time'. The time format of the two text fields are 11:30 am 01:30 pm. I want to give alert message in javascript when the users enter the to time less than the from time.
karthik_ppts
81
Posting Pro
Recommended Answers
Jump to Post<html> <script language="javascript"> function validate(dt1,dt2) { var jdt1=Date.parse('20 Aug 2000 '+dt1); var jdt2=Date.parse('20 Aug 2000 '+dt2); alert(jdt1); if(jdt1==NaN) { alert('invalid start time'); return false; } if(jdt2==NaN) { alert('invalid end time'); return false; } if (jdt1>jdt2) { alert('start is greater'); } else { alert('start is less equal'); } …
All 2 Replies
urtrivedi
276
Nearly a Posting Virtuoso
karthik_ppts
commented:
Helpful post
+6
karthik_ppts
81
Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.