cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <>
Subject Re: AW: Client-side validation in CForms
Date Mon, 14 Jul 2008 10:41:00 GMT
Hi Christofer

On 13 Jul 2008, at 13:13, Christofer Dutz wrote:

> When I was working on my first attempts to do exactly what you are  
> trying to
> do (CForms using dojo 1.1 and client side validation), I ran into  
> exactly
> the same problem as you did. I too think it would be easily possible  
> to
> implement client and server-side validation using dojo. Even if it  
> would not
> be possible to implement all.
> Unfortunately the fi-output is hard-coded into the widget class
> implementation and no validation information is sent. Making client- 
> side
> validation work, it would make it necessary to patch every single  
> Widget
> class to output this validation-data, but should be easy to  
> accomplish.
> I stopped my work on this, since I had doubt's anyone would be  
> interested in
> a feature like this and the thought of having to maintain patches  
> for so
> many classes let me drop that idea.

I had a look as well and did not fancy ploughing in to the code to add  
this right now, as I have so much else to do before I can release the  
client-side stuff (hence asking for volunteers .... )

What I am working on in the meantime is using the (existing)  
<fi:datatype base="string|integer|long|double|float|decimal"/> tags to  
perform basic datatype validation on the client. My hope is that  
adding support for this now, will make it easier to add fuller  
validation client-side in the future.

BTW. Christofer, I attempted to contact you earlier about the private  
work you said you had been doing on Dojo 1.1, to see if I could roll  
it into my work. If you are interested in contributing, please contact  
me off-list.

Many thanks

regards Jeremy

> -----Urspr√ľngliche Nachricht-----
> Von: Jeremy Quinn []
> Gesendet: Mittwoch, 9. Juli 2008 17:17
> An:
> Betreff: Client-side validation in CForms
> Hi All
> As you may know, I am working heavily on the revamp of Dojo on the
> client-side of CForms.
> In Dojo it is possible to perform quite a lot of validation on form
> fields. There is a partial match between the validation capabilities
> of CForms and those of Dojo. Several people have thought in the past
> that it would be good to have the same validation occur on both the
> server and the client.
> OTTOMH, the kind of validators we could probably make work in both
> places would be :
> 	email, length, mod10, range and regexp (plus maybe javascript, if we
> can sort out any context differences)
> ATM however, no validation information is output by the form
> generation process. Datatypes are there (which I can initially use)
> but no validation.
> So my question is, would someone volunteer to either add the
> definition's validation tags to the output or help work out the
> cleanest approach to adding it?
> Many thanks
> regards Jeremy

View raw message