Ok,  I found some references in the mailing list to this
functionality being removed at 2.1.5 in favour of widget
validators.
(http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=108639582110249&w=2)

So how do they work?  Anyone have a sample peice of code?

>>> Phil Snowdon 4/08/2004 9:08:51 a.m. >>>
Take this snippet from the samples.  Supposedly if the price is
less than one, then it will show a validation error.  It
doesn't.

 <fd:validation>
    <!-- This demonstrates form level validation -->
    <fd:javascript>
      var success = true;
      var price = widget.lookupWidget("dieselprice");
      if (price.value &lt; 1) {
          price.setValidationError(new
Packages.org.apache.cocoon.forms.validation.ValidationError("It
can not be that low!", false));
          success = false;
      }
      
      // Must return true/false
      return success;
    </fd:javascript>
  </fd:validation>

even simpler

  <fd:validation>
    <fd:javascript>
      return false;
    </fd:javascript>
  </fd:validation>

Which should always generate a validation error doesn't seems to
either.

Is this a known issue?  There's a comment in the Form.js code
    // FIXME: Remove check for removed syntax later.
    if (this.validator != undefined) {
        throw "Forms do not support custom javascript validators
anymore. Declare your validators in the form model file.";
    }

Does this mean that we can't use javascript validadtors anymore.
 What does it mean by declaring your validators in the form model
file?

Cheers

Phil

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to