cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lundquist>
Subject [cforms] Clear validation error on a widget?
Date Wed, 14 Apr 2004 16:36:17 GMT

I have a repeater whose rows contain:
	• a text field that notionally is required, but is not declared as 
such in the definition (see below)
	• a "delete me" booleanfield.

The field is not @required="true", because if the user clicks to add a 
row and then decides they don't want it after all, they must check the 
"delete me" box on that row and submit the form.  So this state (text 
field empty, box checked) must be valid.

So I'm doing a check in the form.onValidate handler.  I call 
setValidationError() on the text widget in the error case (field empty, 
"delete me" not checked), and that works fine.

But I also need the ability to clear the validation error if the field 
is empty and the "delete me" box is checked.  How do I do this?

I tried setValidationError (null), but that didn't do the trick.

Any ideas?


View raw message