Results 1 to 2 of 2

Thread: How to set date in textbox?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2000
    Posts
    1,463

    Question How to set date in textbox?

    Hello,

    I have a StartDate and EndDate in an ASP.NET using VB.NET When the user fills in the StartDate and leaves that field I want to call a script to look at the EndDate and if it is earlier than the StartDate I want to set the EndDate to the same as the StartDate.

    Can anyone point me in the direction for this?

    Thanks!!

    Warren

  2. #2
    Hyperactive Member jasonwucinski's Avatar
    Join Date
    Mar 2010
    Location
    Pittsburgh
    Posts
    452

    Re: How to set date in textbox?

    Do you want to do this in javascript or on the server? With JS, you will need to attach an event to the first textbox for when the tb looses focus. Then, use the DOM to get the value of the second TB. if it's empty, copy the first to the second. In JS, you can get a handle of an object, through the document object model, this way:

    Var myTB = document.getElementByID("<%= ClientID.MyTbName %>")
    if i was able to help, rate my post!

Posting Permissions

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



Click Here to Expand Forum to Full Width