PHP Form Builder Class / Examples / Fieldsets

Version: Released:

Fieldsets - Fieldsets are applied to your forms by using the project's openFieldset/closeFieldset functions. Below, you will find one way that you can use fieldsets in your development.

Name
Address
Email Addresses
Phone Numbers
Processing

<?php
$form 
= new form("fieldsets_0");
$form->setAttributes(array(
    
"width" => 500,
    
"map" => array(21323)
));

if(!empty(
$_GET["errormsg_0"]))
    
$form->errorMsg filter_var(stripslashes($_GET["errormsg_0"]), FILTER_SANITIZE_SPECIAL_CHARS);

$form->addHidden("cmd""submit_0");
$form->openFieldset("Name");
$form->addTextbox("First Name:""FName");
$form->addTextbox("Last Name:""LName");
$form->closeFieldset();
$form->openFieldset("Address");
$form->addTextbox("Address:""Address");
$form->addTextbox("City:""City");
$form->addState("State:""State");
$form->addTextbox("Zip Code:""Zip");
$form->closeFieldset();
$form->openFieldset("Email Addresses");
$form->addEmail("Email Address:""Email");
$form->addEmail("Alternate Email Address:""AlternateEmail");
$form->closeFieldset();
$form->openFieldset("Phone Numbers");
$form->addTextbox("Mobile/Cell:""Mobile");
$form->addTextbox("Home:""Home");
$form->addTextbox("Work:""Work");
$form->addButton();
$form->closeFieldset();
$form->render();
?>