[Formsess-devel] client side validators and dynamic forms, release
Status: Beta
Brought to you by:
mrkatana
|
From: David <da...@df...> - 2004-02-23 12:34:38
|
Hello,
> how would you approach the problems of client side validators
> and dynamic forms (e.g. fields located in a control structure / loop)
> ?
I think the easiest solution is just straight forward:
The <fs:validate..> tags should be parsed to {fs_validate..} function
calls.
The smarty_fs_validate function should add the validator to a stack.
The javascript code for validation should be generated at the end of the
form from that stack.
That would work for the client side but we need to change the handling
of the server side too, don't we?
Otherwise checks for fields which are conditionally displayed would
return errors if the fields are not displayed.
(But the checks would be executed anyway.)
Basically that would end up in porting all the prefilter stuff to smarty
functions..
Anyway, what I suggest is making the HEAD branch ready for release what
means finishing the new OO model and cleaning up the api.
The new api (eg getValue() instead of get_value()) will break
compability anyway, so why make people use the old incompatible 2.0
version?
I'm willing to do some work, just tell me what to do.
> Since Client Side validation is handled by a prefilter, no logic is
> when the JS code is generated, making it impossible to generate proper
> code. I have a little idea about how to implement it, but it's still a
> dirty draft, with nothing even written down, only ideas in my head.
> Another critical topic is "splitting forms in several files". How many
> times didn't I answer "no, formsess can't do that" when I'm asked why
> strange error messages appear when a template contains something like
> <fs:form...>{include file="_form.tpl"}</fs:form>
> For this one I don't have an accurate idea yet but I'm sure it's
> possible :)
Wouldn't my suggestion porting the prefilter- to smarty-function fix that
as well?
I like the idea, that the xhtml tags are just a wrapper for the smarty
function, so why not move all functionality away from the prefilter?
(So one could even use the smarty-functions directly which is not that
nice but more flexible.)
But as the dynamic form thing form above, I would schedule that after
the release of the current HEAD branch.
- david
ps: I'm using a modified version of the 2.0 branch in many of my
projects but that's really dirty so I would like to have a stable
fullfeatured release as soon as possible.
|