cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kamal Bhatt <>
Subject cforms - validating integers
Date Sun, 26 Feb 2006 22:15:13 GMT

I have a cform with the following field:

    <fd:field id="min_duration" required="false">
        <fd:label>Min Duration</fd:label>
        <fd:datatype base="integer"/>
          <fd:regexp pattern="[0-9]*"/>
          <fd:range min="1" max="99">
            <fd:failmessage>Max duration must an integer greater than 1 
and less than 99</fd:failmessage>

When I enter a non-integer character (eg 'a'), the cform fails on save. 
All other validation works, but obviously, validation does not work 
until the field is bound to the variable. My question is how to get the 
field to validate without using javascript (at the form template level) 
to do so (for the sake of consistency).



Kamal Bhatt

Tourism Technology Pty Ltd

T:  +61 (02) 9956 7300
F:  +61 (02) 9956 7411

Level 10, 1 Pacific Highway, North Sydney, NSW 2060

Disclaimer: This email is confidential and may contain privileged information for the sole
use of the person or business to which it is addressed. If you are not the intended recipient,
please notify the sender by return e-mail or phone as you must not view, disseminate, distribute
or copy this email without our consent. We do not accept any liability in connection with
any computer virus, data corruption, incompleteness, or unauthorised amendment of this email.
It is the sole responsibility of the receiver to scan for viruses before opening.

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

View raw message