I'm working on a history form, and one of the text boxes is for the year...what I'm wondering is, if someone enters say 09 instead of 2009 can I have a piece of code that changes the text box to the 4 digit year instead of a 2 digit. I know how to do it to display in the chart note, but I want the actual text box to be changed as well.
Thanks!
Try something like this in the white space
{fn Adjust_year(year){
if size(year) == 4 then
return year
else if size(year) == 2 then
if val(year) > 60 then
return ("19" + year)
else return ("20" + year)
endif
else userok("Invalid year entered, please try again.")
return ""
endif endif
}}
{DOCUMENT.YEAR = Adjust_year(DOCUMENT.YEAR)}
replace DOCUMENT.YEAR with your document variable name. If the obsterm is linked to the document variable then the text translation and obsterm will be automatically updated.