EZForm announcement

21 04 2006

I am currently working on a PHP library named EZForm. This library is intended to enable you to create HTML forms with custom business and automatic datatype checking.

In order to create a Form, you have to follow two steps :

  1. Write a small XML file describing the form sections and data fields, with type specification and restriction. For example, to create an integer field with value constrained between 1 and 10, you may simply write :

    <integer name="children" required="no">
    <!-- Visible label of the field -->
    <label>Your number :</label>
    <!-- The character length of the field - optional -->
    <length>2</length>
    <!-- Minimum value -->
    <min>0</min>
    <!-- Maximum value -->
    <max>10</max>
    <!-- Your business-rules validation function -->
    <specificvalidation>checkChildCount</specificvalidation>
    <!-- Required empty tag for internal error management -->
    <ezformerror/>
    </integer>
  2. Write a PHP skeleton page, with only your business-rules validation functions for some fields, and your final processing functions (inserting and updating supported within only one page)

And that’s all, everything is managed by the library. It generates automatically form visual sections, field names, HTML controls, with examples and constraints explained.

Other features :

  • You can custom your form look with flexible CSS classes
  • Lists can be loaded directly from a database with mapping tags in the xml file (with extended where, orderby, and limit clauses)
  • List selection count is fully managed : min, max selected items, * supported for max
  • Lists are automatically transformed to corresponding HTML control depending on min/max constraints
  • Date types with min/max constraints
  • Cutom field type based on regular expression validation (for example phone number)
  • File uploading supported with custom processing and deleting functions, “can be deleted” attribute
  • Native supported types : string, integer, list, email, date, file, text (long strings), customtype

For example, a quite big form with 20 fields in 3 sections can be done with :

  • A XML file about 150 lines long (including whitespaces and pretty indentation)
  • A PHP file about 75 lines long (including headers, etc)

More information and a specific page will be created soon on this blog.


Actions

Informations

Laisser un commentaire

Vous devez être connecté pour poster un commentaire




Parse error: syntax error, unexpected '/' in /mnt/106/sda/6/e/prog13/wp-content/themes/freshy/footer.php on line 18