How to use javascript to fill a textbox when two others are filled

Gunslinger08

Lifer
Nov 18, 2001
13,234
2
81
So I have two asp textboxes which accept dates, and a third which displays the number of days between them. How would I set it up so that once they're both filled, javascript prints the number of days in the 3rd box?
 

Gunslinger08

Lifer
Nov 18, 2001
13,234
2
81
Originally posted by: KB
Add onchange events to both textboxes and have them run the same method.

The method will check that both are filled in and then do the calculation of days.
To learn date calculation go to this page:

http://www.javascriptkit.com/javatutors/datedifference.shtml

Anyway to do this with asp:Textboxes? I figured you could call a javascript function from the OnTextChanged event, but I can't figure out how.