[Zope] Validating data entry (dates)

Henny van der Linde Henny van der Linde" <linde@inline-info.nl
Fri, 10 Dec 1999 02:04:05 +0100


Hi Jens,

> my suggestion for data validation *before* submitting the form would be
> javascript. (is that blasphemy??? ;)

Blasphemy no (for me at least;) I was hoping that i could avoid Javascript.
Mixing DTML and Javascript for such
a simple task  seems to me a bit messy.

> DTML is interpreted on the server, so you would not be able to validate
> using DTML without sending the data back to the server...

Shame om me, that's something I completly overlooked. That said it would be
nice if you can evaluate the outcome of a form submit, trapping errors.
Something like (Delphish pseudocode):

 if form.submit.errocode <> 0 {an error accured) then
 begin
  case errorcode of
   begin
     00001: ShowMessage('InvalidDate');
   end;
 end

 Henny van der Linde