PHP Classes
elePHPant
Icontem

File: ex-Form.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of carex  >  Form Table PgSQL  >  ex-Form.php  >  Download  
File: ex-Form.php
Role: Example script
Content type: text/plain
Description: example Form
Class: Form Table PgSQL
Generate Web forms to access PostgreSQL tables
Author: By
Last change:
Date: 9 years ago
Size: 4,150 bytes
 

Contents

Class file image Download
<?php
   
require 'object/form/formInput.php';
   
   
$form=new formInput();
   
$form->SetFormAction('.');
   
$form->SetFormMethod('post');
   
   
//start of form
   
$form->StartOfForm();
   
   
//componen form
    //input type
   
$form->SetInputType('text');
   
$form->SetInputName('test');
   
$form->SetInputValue('test-text');
   
$form->SetInputSize('1');
// $form->SetInputClass('Class');
// $form->SetInputId('Id');
   
$form->SetInputMaxLength('2');
// $form->SetOnBlur('onblur');
// $form->SetOnSelect('onselect');
// $form->SetOnChange('onchange');
// $form->SetOnFocus('onfocus');
   
$form->SetInputForm();

   
//submit type
   
$form->SetInputType('submit');
   
$form->SetInputName('tst');
   
$form->SetInputValue('tst-submit');
// $form->SetInputClass('Class');
// $form->SetInputId('Id');
// $form->SetOnBlur('onblur');
// $form->SetOnSelect('onselect');
// $form->SetOnChange('onchange');
// $form->SetOnFocus('onfocus');
   
$form->SetInputForm();

   
//hidden type
   
$form->SetInputType('hidden');
   
$form->SetInputName('trial');
   
$form->SetInputValue('trial-hidden');
   
$form->SetInputSize('5');
// $form->SetInputClass('Class');
// $form->SetInputId('Id');
// $form->SetOnBlur('onblur');
// $form->SetOnSelect('onselect');
// $form->SetOnChange('onchange');
// $form->SetOnFocus('onfocus');
   
$form->SetInputForm();
   
   
//radio with checked
   
$form->SetInputType('radio');
   
$form->SetInputName('radio1');
   
$form->SetInputValue('trial Radio 1');
   
$form->SetInputSize('5');
   
$form->SetChecked('Checked');
// $form->SetInputClass('Class');
// $form->SetInputId('Id');
// $form->SetOnBlur('onblur');
// $form->SetOnSelect('onselect');
// $form->SetOnChange('onchange');
// $form->SetOnFocus('onfocus');
   
$form->SetInputForm();

   
//radio without checked
   
$form->SetInputType('radio');
   
$form->SetInputName('radio1');
   
$form->SetInputValue('trial Radio 2');
   
$form->SetInputSize('5');
   
$form->SetChecked('');
// $form->SetInputClass('Class');
// $form->SetInputId('Id');
// $form->SetOnBlur('onblur');
// $form->SetOnSelect('onselect');
// $form->SetOnChange('onchange');
// $form->SetOnFocus('onfocus');
   
$form->SetInputForm();
   
   
//checkbox with checked
   
$form->SetInputType('checkbox');
   
$form->SetInputName('checkbox1');
   
$form->SetInputValue('trial Checkbox 1');
   
$form->SetInputSize('5');
   
$form->SetChecked('Checked');
// $form->SetInputClass('Class');
// $form->SetInputId('Id');
// $form->SetOnBlur('onblur');
// $form->SetOnSelect('onselect');
// $form->SetOnChange('onchange');
// $form->SetOnFocus('onfocus');
   
$form->SetInputForm();

   
//checkboc without checked
   
$form->SetInputType('checkbox');
   
$form->SetInputName('checkbox1');
   
$form->SetInputValue('trial Checkbox 1');
   
$form->SetInputSize('5');
   
$form->SetChecked('');
// $form->SetInputClass('Class');
// $form->SetInputId('Id');
// $form->SetOnBlur('onblur');
// $form->SetOnSelect('onselect');
// $form->SetOnChange('onchange');
// $form->SetOnFocus('onfocus');
   
$form->SetInputForm();

   
//text area
   
$form->SetInputType('textarea');
   
$form->SetInputName('Text area test');
   
$form->SetAreaRows('2');
   
$form->SetAreaCols('20');
   
$form->SetInputForm();
// $form->SetInputClass('Class');
// $form->SetInputId('Id');
// $form->SetOnBlur('onblur');
// $form->SetOnSelect('onselect');
// $form->SetOnChange('onchange');
// $form->SetOnFocus('onfocus');

    //select
   
$form->SetInputType('select');
   
$form->SetInputName('selectInput');
   
$form->SetInputSize('1');
   
$form->SetInputValue(array('1','2','3','4','5'));
   
$form->SetData(array('Satu','Dua','Tiga','Empat','Lima'));
   
//u can comment selected property
   
$form->SetSelected(array('','','','selected',''));
   
$form->SetInputForm();
   
//stop of form
   
print $form->EndOfForm();

?>