Help with validating a date input to a dialog
Help with validating a date input to a dialog
- Subject: Help with validating a date input to a dialog
- From: Michelle Steiner <email@hidden>
- Date: Fri, 30 Mar 2001 16:54:54 -0800
Here's the script:
display dialog (my setthedate("Please enter the date in format
"mm/dd/yyyy"."))
on setthedate(prompt)
set DateToSend to (text returned of (display dialog prompt default
answer ""))
try
date DateToSend
on error
my setthedate("Please us the correct format "mm/dd/yyyy"")
end try
return DateToSend
end setthedate
Here is the log:
tell current application
display dialog "Please enter the date in format "mm/dd/yyyy"." default
answer ""
--> {text returned:"aaa", button returned:"OK"}
display dialog "Please us the correct format "mm/dd/yyyy"" default
answer ""
--> {text returned:"01/01/2001", button returned:"OK"}
display dialog "aaa"
--> {button returned:"OK"}
end tell
Why is "aaa" being returned instead of "01/01/2001"?
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------