cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject [CForms] widget validation
Date Wed, 24 Nov 2004 09:22:54 GMT


I want to validate all the field widgets with their 'required '
attribute set to true.

For that I have a <fd:javascript> snippet which calls a function written
in flowscript.

Following is the snippet in my form definition file: -

  <fd:submit id="submit" action-command="submit form">

And this is what I have in my flowscript: -

function validateRequired(wid) {

  print("Calling validateRequired");
  print("get children " + wid.getChildren());
  var widIter = wid.getChildren();
  while (widIter.hasNext()) {
    var widObj =;
	print("Widgets are "+ widObj.getValue() + " Is required " +
	if (widObj.isRequired && widObj.getValue() == null) {
enter a value for the required field"));

The above code throws an error as follows: -

setValidationError is not a function.

I browsed the Cocoon API. I can see that setValidation Error is a method
in the Field Class of the FormModel package.

Can anyone help me in pointing out what could be wrong in the above


Confidentiality Notice

The information contained in this electronic message and any attachments to this message are
for the exclusive use of the addressee(s) and may contain confidential or privileged information.
you are not the intended recipient, please notify the sender at Wipro or
and destroy all copies of this message and any attachments.

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

View raw message