Re: validating a date in hstools?
Posted in 1994
In article <D0pAAE.3xJ@usenews.nrlssc.navy.mil>, <charlie@nrlssc.navy.mil> writes: > in hstools, i have a text field that the user enters a date into. > how do i make sure that they enter a valid date? > > please post any response because my email doesn't work. We basically use a two way method to do this ... Firstly, you can control the format of how the user enters the date in the text box, i.e. dd/mm/yy etc, using an ON KEY event; Secondly, you can use the following code to validate that what the user has entered is a valid date, usually on an ON EXIT event or an ON ENTER of the following control: if (errnr(datevalue(ctstring("InputDate",0))) <> 0) error message "....." end if There are probably a few ways in which you can validate a date, this one works fine for us. Toby Roberts Standard disclaimers apply.