cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gunter D'Hondt <>
Subject Re: CForms: immediate validation of input fields
Date Thu, 14 Oct 2004 08:28:01 GMT
CForms still doesn't have any clientside validations, which in my opinion 
is currently a huge disadvantage coz now you have to declare the 
specifications (datatype, required, format) in the form definition and 
again in your own clientside javascript stuff. It would be perfect that 
the CFormTemplateTransformer could automatically create those clientside 
javascript pieces or at least give a javascript-structure with the 
metadata of each field in it. 
Gunter D'Hondt.

Jan Hoskens <> 
14-10-2004 10:17
Please respond to


Re: CForms: immediate validation of input fields

If I am correct, all stuff happens server-side. The fd:javascript will 
happen at the same moment as the other validations (meaning sever-side, 
on-submit). If you really want to have a client-side validation, you 
can try to set some extra stuff in your template:

<ft:widget id=" ... "><fi:styling onchange=""></ft:widget>

The fi:styling attributes that are not used by the cform stylesheets 
will be copied into your html input element (ending up with <input .... 
onchange=""/>). So you can set a javascript piece in which you validate 
your field in those attributes.

Kind Regards,

Jorg Heymans wrote:

> fd:javascript should be your friend here i think.
> Philipp Rech wrote:
>> Hello Cocooners!
>> I have a CFrom with many fields and other input elements. Validation 
>> (based
>> on the Cforms validation tags) happens when i submit the form. So far 
>> good. Now is it possible (and how) to have Cforms validate user 
>> inputs right
>> away after one field is filled out? So can I call the validation not 
>> only on
>> submit but also when the user focuses (clicks on) the next field on the
>> page? Maybe through the Javascript "onBlur" event handler?
>> Thank you in advance!
>> philipp
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message