These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

year validations

balajjivinodpj
Registered: Mar 10 2007
Posts: 6

this was my previous question..what function or syntax i have to use to validate between two years?
for ex (if a user enters year less than 2005 and greater than a year 2007 it is invalid otherwise it is valid. the format is mm/dd/yyyy it must be validated only using the date/time field in the designer.i need the source i am using live cycle designer 8.0 plz brief it in details. i studied already the notes in site but is not helpful, it tells more about the time difference between two years, but i need to validate only years. plz try to spare ur time and try to help this beginner .
u send me the syntax as
var nYear = Number(MyDate1.rawValue.split("-").pop());its popping out the day only but not the year or month. can u plz rearrange the syntax as it pops up the year.thanx for ur efforts.. sincerley waiting for ur reply....

My Product Information:
Acrobat Standard 8, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Oops, the date format in XFA date fields is backwards, i.e. "2007-3-21", so use this modified script

var nYear = Number(MyDate1.rawValue.split("-").shift());

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script