cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Artur Bialecki" <>
Subject RE: Logging and Form Validation
Date Fri, 07 Jun 2002 21:13:35 GMT

This is what we do for client side validation.
WARNING: requires javascript but my clients are not
"regular" web users.

For my app I provide validation in my XSP, eg:
    <ruleset id="username">
      <rule name="regEx" msg="- User Name must be alphanumeric. Valid characters: 0-9,
a-z, A-Z, _">
      <rule name="required" id="OEM-055" msg="User Name is required"/>
    <ruleset id="email">
      <rule name="regEx" msg="- Email address must be in following format:">

so for each from field that needs to be validated I have 
<ruleset> with id of the form field and one or more rules.
I also provide validation template that reads the /page/validators
and creates validateAndSubmit() javascript function that
validates all fileds specified in XSP.
Form filed name must match validator names but that's easy.
I define validators in XSP since some of them are based
on DB queries.

This works great for us.

We also validate on server side with automagic annotation
of errors and from field repopulation since not everything
can be validated on the client side (eg: does city Bumbomie
exsits?) so I our clients ask for support for javascripless
browers (which they wont) it will still work.

Just my 2 cents.


Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message