on 06-27-2008 5:41 AM
Hi all,
My requirement is that i have a date field with the calendar help.i have set the current date as default in that field. Now i have to display an error message if i select a date 6 months older than the current date.Can anyone please guide me on this. I need it urgently.
Points rewarded for helpful answers.
Regards,
Srividya.
Hi Srividya,
Write the following FormCalc Script at the exit event of your Date Field:
Var val1 = substr((Num2Date(Date(), "DD/MM/YYYY")), 1, 2) - substr((Num2Date((IsoDate2Num($.rawValue)), "DD/MM/YYYY")), 1, 2);
Var val2 = substr((Num2Date(Date(), "DD/MM/YYYY")), 4, 2) - substr((Num2Date((IsoDate2Num($.rawValue)), "DD/MM/YYYY")), 4, 2);
Var val3 = substr((Num2Date(Date(), "DD/MM/YYYY")), 7, 4) - substr((Num2Date((IsoDate2Num($.rawValue)), "DD/MM/YYYY")), 7, 4);
if ( val3 > 0 )
then
val2 = val2 + 12
endif
if ( val1 >= 0 and val2 == 6)
then
$host.messageBox("Do not enter a date vold more than 6 months")
elseif (val2 > 6)
then
$host.messageBox("Do not enter a date vold more than 6 months")
elseif (val3 > 1)
then
$host.messageBox("Do not enter a date vold more than 6 months")
endif
here val1 is form counting date, val2 is for counting month and val3 is for years.
I have to spend a lot of energy to write it so hope it will solve your problem.
Regards,
Vaibhav Tiwari.
Edited by: Vaibhav Tiwari on Jun 27, 2008 4:43 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vaibhav,
I have added the code wat you have given to the date field.But when the error pops up in the output,it is displaying a small error screen inside a blank adobe screen which remains even after clickin ok on the error message.Can you please guide me on how to remove this blank adobe screen.
Regards,
Srividya.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.