Hello,
I am a newbie to designer and am trying to create a form field whereby a user will have to input the 4 digit year in a text field. the range of years would be from two years ago to the present (ex. from 2006 to 2008).
Initially I tried using the date/time field but couldn't find a way to exclude the month, date and popup calendar. Then I tried some javascript code in the validation event and at did not work.
What is the best way to approach my problem. If you are using a text field to input numerical values does the validation occur in the validation event or the enter event. Also what code should I use to make it work. Thanks.
Or one can use FormCalc's "Date2Nm()" and "Num2Date()" functions to reformat the date stirng to just the 4 digit year?
// get the number of days from DateField with the format "MMM DD, YYYY"
var DateNum = Date2Num(DateField.formattedValue, "MMM DD, YYYY")
// Use the format to extract the 4 digit year
var YearOnly = Num2Date(DateNum, "YYYY")
George Kaiser