A
A
Alexey Berdnikov2010-09-14 15:03:49
PHP
Alexey Berdnikov, 2010-09-14 15:03:49

Does form-builder (PHP) + validator (client+server) exist in nature in one bottle?

Is there a flexible form-builder (PHP) that allows you to assign rules for server and client validation at the same time?

Actually, the question is not to repeat the same work twice, in particular, on Habré there has already been an attempt to comprehend this problem and one of the solutions has been proposed (or rather, its prototype) and, as they correctly noted:

the main idea is the generation of client-side validation on the server


For example, for client-side validation and building all sorts of goodies like repeating blocks (for example , zforms.ru/docs/repeatable-model/ ), there are beautiful solutions like zforms.ru/ from Dmitry Filatov
, a Yandex interface developer using jQuery.
In the end, there is Vanadium: semantic validation on the client

For building forms and server validation, there is a wonderful library by Alexey Borzov and, as Alexey himself corrected me , Bertrand Mansion : HTML_QuickForm2 .

There is a first version of HTML_QuickForm which allows you to do what is required, ie. build forms and, based on the requested server validation rules, generate client validation rules on the fly, but it has a huge disadvantage - the inability to build complex forms in simple ways, i.e. when it is required, for example, to add a group of fields to a group, but it works out very well with flat forms.

Dmitry Filatov answered my question whether there is a wrapper for building such forms in MyKrug:
There is not a wrapper in PHP, but an xml description of the validation rules, from which the client code is built using xsl and which can be used for server validation.


Alexey Borzov answered the question about the further fate of HTML_QuickForm2 :
HTML_QuickForm2 is in alpha because, again, the functionality is not completed (namely, integration with javascript). But unlike the old version, it is almost 100% covered by tests and is clearly no worse in terms of stability...


In other words, there is a wild desire to make friends between HTML_QuickForm2 and zforms.ru, but before that I would like to ask "lazy programmers" how they deal with laziness when building forms and double work on checking input data?

update: the issue was resolved by running the project jquickform.ru/

Answer the question

In order to leave comments, you need to log in

9 answer(s)
A
Alexey Berdnikov, 2010-10-01
@Groove

For history: the issue was resolved by launching the jquickform.aberdnikov.ru project

B
BaBL, 2010-09-14
@BaBL

In other words, there is a wild desire to make friends between HTML_QuickForm2 and zforms.ru, but before that I would like to ask "lazy programmers" how they deal with laziness when building forms and double work on checking input data?

we say to ourselves: do this and you can eat a chocolate bar. And we sit and do.

C
corristo, 2010-09-14
@corristo

did something similar for CodeIgniter, client rules were generated according to server rules, which were already fed to the mentioned Vanadium.
But it did not reach complex forms.

M
Melz, 2010-09-15
@melz

Have you tried this library?
code.google.com/p/php-form-builder-class/
Examples at the bottom of the page.

G
gabriell, 2010-09-15
@gabriell

Have you looked in the direction of frameworks? For example, codeigniter has an option for both validation and form building - quite powerful!

T
tzlom, 2010-09-14
@tzlom

I use a self-written thing to generate validation rules based on layout, though the validator is only server-side

M
mr_idiot, 2010-09-15
@mr_idiot

Is it not comme il faut to validate with Ajax through the server side?

M
Max Kamashev, 2010-09-15
@ukko

Kohana has both a form generator and a validator... But you probably need something decoupled from frameworks...

A
Alexey Berdnikov, 2010-09-15
@Groove

By the way, in the SVN "HTML_QuickForm2" work is already underway to implement the generation of a client-side validation script.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question