PHP Classes

File: Example

Recommend this page to a friend!
  Classes of Jakub Kuritka  >  Leopard Form  >  Example  >  Download  
File: Example
Role: Example script
Content type: text/plain
Description: Example of using leopardForm
Class: Leopard Form
Compose, output and validate HTML forms
Author: By
Last change: Renamed jablko (in czech language) to apple
Date: 11 years ago
Size: 1,098 bytes


Class file image Download
$form = new leopardForm("name", "index.php", "POST");
    $form->addText("Stupid form");
    $form->addTextInput("number", "Write number from 5 to 10","",array(rules::NUMBER, rules::MINI => 5, rules::MAXI => 10));
    $form->addTextInput("url", "Site url", "http://",array(rules::URL));
    $form->addPassword("passwd", "Write password", array(rules::NOTEMPTY));
    $form->addRadio("gender", "Select your gender", array("m" => "men","w" => "women"),"m",false,array(rules::NOTEMPTY));
    $form->addSelect("select", "Choose fruit", array("a" => "apple", "o" => "orange"), "apple",array(rules::NOTEMPTY));
    $form->addTextArea("textarea", "Lang text", "",array(rules::NOTEMPTY));
    $form->addCheckBox("Terms", array("t" => "I accept the terms of use","t2" => "I accept the second terms of use"),array("t2"),false,array(rules::NOTEMPTY));
    $form->addButton("Button", "value", "reset");
        echo $form->getData(formElement::TEXTINPUT, "number");
      } else {
        echo $form;
    } else {
      echo $form;

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