Forums.Sureshkumar.net : A Perfect Place to Share Knowledg Blogs   Games  Magazines   click here

"Sharing knowledge does not lessen your store, often it gets you more. Sharing plays a key role in relationships and bonding, happens in small steps and is assisted through community membership."

Go Back   SURESHKUMAR.NET FORUMS > CAREER SUGGESTIONS & GUIDELINES > Ask for Suggestion
Register FAQ Members List Calendar Games Blogs Search Today's Posts Mark Forums Read

   

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 07-02-07, 12:53 PM   #1 (permalink)
Junior Member
 
Join Date: Feb 2007
Age: 24
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 2 balasri1984 is on a distinguished road
Question How to compare dates in javascript?



hi ,
i need to validate and check two date fields startdate and enddate so that the enddate must be greater than the startdate in javascript.
can any one help me ?

bala
balasri1984 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-02-07, 01:06 PM   #2 (permalink)
Moderator
 
kiran2710's Avatar
 
Join Date: Jul 2006
Posts: 2,186
Thanks: 5
Thanked 402 Times in 275 Posts
Thanks: 5
Thanked 402 Times in 275 Posts
Rep Power: 62 kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute
Re: doubt in javascript (urgent)

Check dis link, hope u vil get answer.........

Performing Form Validation with Validation Controls > Comparing Values: The CompareValidator Control
__________________



Kiran







kiran2710 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-02-07, 02:05 PM   #3 (permalink)
Super Moderator
 
sk_kireeti's Avatar
 
Join Date: Feb 2006
Location: Hyderabad
Posts: 2,355
Thanks: 117
Thanked 255 Times in 206 Posts
Thanks: 117
Thanked 255 Times in 206 Posts
Blog Entries: 4
Rep Power: 53 sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute
Re: doubt in javascript (urgent)

function getDateObject(dateString,dateSeperator)
{
//This function return a date object after accepting
//a date string ans dateseparator as arguments
var curValue=dateString;
var sepChar=dateSeperator;
var curPos=0;
var cDate,cMonth,cYear;

//extract day portion
curPos=dateString.indexOf(sepChar);
cDate=dateString.substring(0,curPos);

//extract month portion
endPos=dateString.indexOf(sepChar,curPos+1); cMonth=dateString.substring(curPos+1,endPos);

//extract year portion
curPos=endPos;
endPos=curPos+5;
cYear=curValue.substring(curPos+1,endPos);

//Create Date Object
dtObject=new Date(cYear,cMonth,cDate);
return dtObject;
}
var startDate = getDateObject(document.groupForm.Date.value,"/");
var endDate = getDateObject(document.groupForm.endDate.value,"/");[FONT=verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif]
[/font]if(startDate < endDate)
alert("startDate is less than endDate");
if(startDate >= endDate)
alert("startDate is greater than or equal to endDate");
__________________
Give 1 cup rice to a hungry Indian just by a mouse click. No money, no form filling, no hassle... Click here for the donation.
sk_kireeti is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-02-07, 06:53 PM   #4 (permalink)
Junior Member
 
Join Date: Feb 2007
Age: 24
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 2 balasri1984 is on a distinguished road
Re: doubt in javascript (urgent)

thank u ......
balasri1984 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mega Free Download S/W Links A-Z yathish OTHERS 514 26-12-08 05:16 PM
Openings for JAVASCRIPT MASTERS in Intrasoft Technologies santhu FRESHER JOBS 0 20-12-06 07:49 PM
Compare Infobase Pvt.Ltd.: HTML Programmer sridhar FRESHER JOBS 3 29-08-06 03:51 PM
JavaScript Qs Set - 1 vjsreevs WEB DESIGNING, DEVELOPMENT ,PROMOTION & SEO 4 07-08-06 10:20 PM
JAVASCRIPT INSECURITIES wizkid SYSTEM SECURITY & ETHICAL HACKING 0 29-07-06 03:31 PM


All times are GMT +6.5. The time now is 01:53 PM.




Get Short Listed Fast !! Upload Your CV here & Apply New Jobs Everyday.

Search Engine Optimization by vBSEO 3.1.0