• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Problem with java script date validation

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,


can u please tell me how can i add +90 days when a date is selected?
i want to write code in sucha way tht whenever fromdate(text box) is selected using calendar it should automatically add+90 and display in the other textbox(todate).
the date format is d-mon-yyyy(ex:02-jan-2006).
when i enter 02-jan-2006 in the text box(fromdate)
it should automatically add +90 and display in other text box(todate)

can u give me suggestions?

Thanks in advance
Santhosh
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The basic idea is:

var d = new Date(strDate);
d.setDate(d.getDate() + 90);

Now to get it back into that format will be fun for you to figure out.

Eric
 
He baked a muffin that stole my car! And this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic