Issue 42 in php-form-builder-class: Easy way to extend the class with new elements

11 views
Skip to first unread message

php-form-bu...@googlecode.com

unread,
May 19, 2010, 2:32:35 AM5/19/10
to php-form-bu...@googlegroups.com
Status: Accepted
Owner: moncojhr
Labels: Type-Enhancement Priority-Medium

New issue 42 by moncojhr: Easy way to extend the class with new elements
http://code.google.com/p/php-form-builder-class/issues/detail?id=42

The issue by tom.berend "big picture.." , seems to be partly a request for
an easy way to extend the class, or a plug-in based system.

A user should not have to modify the class if there is not a specific type
of element already included.

I think we should only include the particularly standard element types in
the class, and then modularize the other elements.

They could be each a simple file that is loaded from the includes
directory, and then can be called through the form.

php-form-bu...@googlecode.com

unread,
May 20, 2010, 9:55:10 AM5/20/10
to php-form-bu...@googlegroups.com

Comment #1 on issue 42 by ajporterfield: Easy way to extend the class with
new elements
http://code.google.com/p/php-form-builder-class/issues/detail?id=42

Sounds like a good idea. Some of the finer details may be a challenge to
integrate into class.form.php though.
How would js/php error checking work with the modularized form elements?
Which of the current elements
would be considered standard?

- Andrew

php-form-bu...@googlecode.com

unread,
May 21, 2010, 12:57:48 AM5/21/10
to php-form-bu...@googlegroups.com

Comment #2 on issue 42 by moncojhr: Easy way to extend the class with new
elements
http://code.google.com/p/php-form-builder-class/issues/detail?id=42

Perhaps all elements should be modularized, since there isn't really any
benefit to
having some of them hard-coded in the class.

There could be two different ways they could specify how the element will
be checked,
a simple way where they can just set a single regex or a more complex way
where they
could specify a function for checking the input.

The form class will then use that regex/function to decide it the input is
valid, and
then create then handle creating the js/php validation checking and error
message output.

I'm imagining there will be a folder in includes/ called "modules" and
inside
multiple files.. textbox.php captcha.php googlemap.php etc

Inside each will be a standardized structure, (element object?) , and it
will set a
few variables such as:

htmloutput
jsoutput
validation

and others that will be obvious when we actually implement it.

I think before we start to try and implement this we should create an
element with a
good structure, and afterwards actually convert the current elements to that
structure and make the form class handle it.

Reply all
Reply to author
Forward
0 new messages