On Wed, 2004-06-30 at 13:01, Jeremy Quinn wrote:
> Hi All
> 
> I need to validate (within the CForms framework) that a set of 
> checkboxes have all been checked.
> 
> I have tried adding <fd:validation/> but it does not appear to have an 
> effect :

Checked the source: it's indeed not supported. Probably for no
particular reason.

Possible options are:

* adding support for it. Should be no more then adding the following
line to the class BooleanFieldDefinitionBuilder:
setValidators(widgetElement, definition);
I don't have time to test that, but since you already have an example
worked out you could give it a try.

* on any widget you can add validators at runtime using the addValidator
method. Given that you need to check a set of checkboxes, it might be
easier to add a validator to the parent widget of those checkboxes,
rather then adding a validator to each seperate checkbox.


> 
> <fd:booleanfield id="mod-copyright">
>    <fd:label>
>      <i18n:text 
> i18n:catalogue="local">moderate.mod-copyright.label</i18n:text>:
>    </fd:label>
>    <fd:hint>
>      <i18n:text 
> i18n:catalogue="local">moderate.mod-copyright.hint</i18n:text>
>    </fd:hint>
>    <fd:help>
>      <i18n:text 
> i18n:catalogue="local">moderate.mod-copyright.help</i18n:text>
>    </fd:help>
> 
>    <!-- this does not work -->
>    <fd:validation>
>      <fd:assert test="mod-copyright = true">
>        <fd:failmessage>
>          <i18n:text 
> i18n:catalogue="local">moderate.mod-copyright.error</i18n:text>
>        </fd:failmessage>
>      </fd:assert>
>    </fd:validation>
> 
> </fd:booleanfield>
> 
> Is there a way of handling this?
> 
> thanks for any suggestions.
> 
> regards Jeremy
> 

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
[EMAIL PROTECTED]                          [EMAIL PROTECTED]


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

Reply via email to