OOhForms are part of the PHPlib-Mini-Framework (Examples from KUSKUS)
New form:
require($_PHPLIB["libdir"]."oohforms.inc"); $fo = new form; // create a form object for form
$fo->add_element(array("type"=>"select", "name"=>"f_person_gender", "valid_regex"=>"^[a-z]*$", "valid_e"=>"", "options"=>array(array("label"=>"K. Anrede","value"=>"0"), array("label"=>"Herr","value"=>"1"), array("label"=>"Frau","value"=>"2") ), "size"=>1, "value"=>$f_person_gender));
$fo->add_element(array("type"=>"submit", "name"=>"submit", "value"=>"Abschicken"));
// which kind of calculation?
reset($picture_calculate_type);
unset($t);
foreach($picture_calculate_type AS $key => $val){
if (is_array($calculation_type)){
if (in_array($key, $calculation_type))
$t[] = $key;
} else {
if (($calculation_type & $key) == $key)
$t[]= $key;
}
}
$fo->add_element(array("type"=>"checkbox",
"name"=>"calculation_type",
"value"=>$t,
"multiple"=>1));
$fo->add_element(array("type"=>"hidden", "name"=>"selfcall", "value"=>"yes"));
name
val
extrahtml (will be displayed with leading space)
rows
cols
wrap
extrahtml (will be displayed with leading space)
$fo->add_element(array("type"=>"text", "name"=>"f_person_title", "valid_regex"=>"^[a-z]*$", "valid_e"=>"Bitte nur Buchstaben beim Titel des Ansprechpartners<br>", "size"=>12, "maxlength"=>60, "icase"=>1, "value"=>$f_person_title));
// start // OOf mainform... $fo->start("", "GET", $PHP_SELF, "", "msgform"); // Start displaying form // display element: $fo->show_element("submit"); // Show submit // display multiple elements: $i=1; reset($picture_calculate_type); foreach($picture_calculate_type AS $key => $val){ if ($i++ % 2 == 1) echo "<span style=\"font-size:8pt; background-color: #D1D1D1\">"; else echo "<span style=\"font-size:8pt; background-color: #F4F4F4\">"; $fo->show_element("calculation_type", $key); echo " ".$val."</span>\n"; } // finish: $fo->finish(); // Finish form