Forms are essential for any dynamic site. Tangra framework provides vary rich form functionality that makes easy to define forms, automatically generate HTML for them, validate submitted input, AJAX usage, etc. This chapter will present basics about how to work with forms and later in Chapter 15, Forms: Advanced Usage we will discuss more complicated topics.
Main components are:
Form and descendant classes. Represents HTML form.Form_Field and descendant classes - TF provides ready-to-use classes for common types like text, integer, date, email, etc. Additionally you can easily create your own types to reflect your needs. Each Form_Field_* class contains mechanism for validating submitted input.Form_View and descendant classes. Represents form view.Form_Field and descendant classes. Represent form field views.At first creating a form may look kind of complicated but when you get used to it you will be able to create simple form in about 5 minutes. In future versions of Tangra Framework (more precise in TCC) we will add wizard for creating forms where you can chose in GUI what fields to include (or may be even easier - choose DB table and TCC will generate the form for it).