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
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 %>")