PHP Classes

File: testform.php

Recommend this page to a friend!
  Classes of Ingus Rukis  >  MyForm  >  testform.php  >  Download  
File: testform.php
Role: Example script
Content type: text/plain
Description: Sample class usage file
Class: MyForm
Form generation class with css, xhtml 1.0 support.
Author: By
Last change:
Date: 19 years ago
Size: 1,497 bytes
 

Contents

Class file image Download
<html><head>
<meta http-equiv="content-type" content="text/html; charset=windows-1257">
<title>Sample :)</title>

<style type="text/css">

body
    {
      margin:20px;
      font-family:verdana;
      font-size:11px;
    }
td
    {
      font-size:11px;
      border-bottom: 1px solid gray;
      border-right: 1px solid gray;
    }
th
    {
      background-color:silver;
      border-bottom: 1px solid gray;
      border-right: 1px solid gray;
    }
table
    {
      border-left: 1px solid gray;
      border-top: 1px solid gray;
    }

</style>
</head><body>

<?php

$el
= array(
             array(
'id'=>'1','text'=>'First item'),
             array(
'id'=>'2','text'=>'Second item'),
             array(
'id'=>'3','text'=>'Third item'),
             array(
'id'=>'4','text'=>'Fourth item')
);


include_once(
'form.class.php');

$frm = new MyForm('testclass.php','POST',True);
$frm->addDropDown('test',$el,'Title',2,1,False);
$frm->addHidden('hidden_var','MyValue:)');
$frm->addTextarea('article','','Full article',15,30);
$frm->addRadioGroup('radio_element_group',$el,'Choose only one of them!',2);
$frm->addCheckGroup('checkbox_element_group',$el,'You can choose more than one',array(1,3,4));
$frm->addCheckBox('viens_checkbox','vertiba','Poor checkbox - left alone');
$frm->addTextinput('teksta_lauks','Text for editing','One-line-text');
echo
$frm->showform('Form demonstration','submit','submit','100%',0,2);

?>

</body></html>


For more information send a message to info at phpclasses dot org.