Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Date Validation

0 views
Skip to first unread message

Richard A. Noble

unread,
Feb 26, 2001, 1:09:12 PM2/26/01
to
Notes 4.5a

Maybe this is an elementary question, but I just can't seem to get a
handle on it.

I am using Domino to present a form to the user's web browser where the
user must enter a date. I am seeking the necessary combination of
Default Value and/or Input Translation and/or Input Validation that will
distinguish between a null date (empty field), a valid date (everything
is as it should be), and an invalid date (garbage in the field).

So far, I can distinguish between null and not-null, but the techinques
I've tried in the not-null case either accept everything (not detecting
garbage) or trip the "Unable to interpret date or time" message rather
than my @Failure message.

I have tried various combinations of @IsError and @IsTime on DateField
and @TextToTime( TextField ) without success.

If you are able to do this validation and maintain control of the error
state, please show me your code.

Uwe Wiesemann

unread,
Feb 26, 2001, 1:56:41 PM2/26/01
to

"Richard A. Noble" <ran...@madison.k12.wi.us> schrieb im
Newsbeitrag news:3A9A9BC8...@madison.k12.wi.us...

> I am using Domino to present a form to the user's web browser where the
> user must enter a date. I am seeking the necessary combination of
> Default Value and/or Input Translation and/or Input Validation that will
> distinguish between a null date (empty field), a valid date (everything
> is as it should be), and an invalid date (garbage in the field).

Hi Richard,

try this:

REM "Validate input of Date and give second try";
AskDate_ := @Prompt([OKCANCELEDIT];"Date";"Please enter date as
DD.MM.YY.";@Text(@Today));

@If(@Text(@TextToTime(AskDate_)) != AskDate_;
@Set("Ask";@Prompt([OKCANCELEDIT];"Date";"Wrong date, please try
again!";AskDate_));
"");

@If(@Text(@TextToTime(AskDate_)) != AskDate_;
@Do(@Prompt([OK];"Error";"Not a correct date!");@Return(""));
"");

@Set("AskDate_";@TextToTime(AskDate_));

REM "Now is a valid Date in AskDate_ or User must try a new Entry";
FIELD Date := AskDate_;

It's only the start, when users date can be in 1999 think, that notes
correct date to 99.

Greetings Uwe

0 new messages