Links: Child Classes Variables Inherited Variables Inherited Methods Methods Variable Detail Method Detail |
FormContent | --SVGGraphForm
Located in File: Program_Root/examples/jilu2.php
It builds a form by creating FormElement objects which have automatic validation. It leaves the layout of the form up to the child class. It has a mechanism in place to automagically show a confirmation 'page' after the data has been submitted and validated. It also provides a hook for any 'back end' validation of data. Finally, it provides a function for handling the action of the form, which only gets call after ALL validation has passed.
Functions:
form_init_elements() - This function is used to build the FormElement objects that will be used by the form. This function is called EVERY time the FormContent class is instantiated. After you create the FormElement, you call the FormContent::add_element() method, to add the FormElement object to the form. You will then call the 2 methods FormContent::element_label() and FormContent::element_form() to get access to the FormElement's label and form field respectively.
form_init_data() - This is called only the first time the form is encountered. It Allows you to populate the FormElements with data from a DB for example. You would use FormContent::set_element_value() or FormContent::set_hidden_element_value() inside here.
form() - This is the method that gets called to build the layout for your form. Typically you use a table and add the label in the first <td> and the form field itself in the 2nd <td>. So there are 2 methods in the FormContent object that allow u to get access to the FormElements label, and form field. FormContent::element_label() and FormContent::element_form().
form_backend_validation() - This method enables you to do any "back end" validation of data. Such as, check for a duplicate in the DB on a create/new form. This is called after the FormElement's validation methods have passed.
form_action() - This method is called after ALL validation was successfull, including each FormElement object's validation methods, as well as the FormContent::form_backend_validation()
Class Variable Summary ^TOP |
Inherited Class Variable Summary ^TOP | ||||||||||||||||||||||||||||||||||||
Inherited From Class FormContent
|
Method Summary ^TOP |
void form ( )
|
void form_action ( )
|
void form_init_elements ( )
|
Inherited Method Summary ^TOP | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Inherited From Class FormContent
|
Variable Detail ^TOP |
Method Detail ^TOP |