SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2008
    Location
    Dhaka, Bangladesh
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Date calculation in text box

    I have two text box one is Receive Date: Another is Delivery Date. When Receive Date text box is on focus then current date will show with time and when Delivery Date text box is on focus then 2 days will be add.

    How can I do this?

  2. #2
    SitePoint Evangelist priti's Avatar
    Join Date
    Aug 2006
    Location
    India
    Posts
    488
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kjaman View Post
    I have two text box one is Receive Date: Another is Delivery Date. When Receive Date text box is on focus then current date will show with time and when Delivery Date text box is on focus then 2 days will be add.

    How can I do this?
    onfocus event can be used.

    myDate=new Date(); //today date.

    myDate.setDate(myDate.getDate()+2; //after 2 days


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •