<?
include("../class.form.php");
if(!isset($cmd))
$cmd = "";
if($cmd == "submit")
{
echo("<pre>");
print_r($_POST);
echo("</pre>");
exit();
}
if($cmd == "")
{
?>
<html>
<head></head>
<body>
<h2 style="text-align: center; margin: 0; padding: 0;">Form Builder Class - Examples</h2>
<h5 style="text-align: center; margin: 0; padding: 0;"><span style="padding-right: 10px;">Author: Andrew Porterfield</span><span style="padding-right: 10px;">Released: <?=file_get_contents('../release')?></span><span>Version: <?=file_get_contents('../version')?><span></h5>
<div style="text-align: center; padding-bottom: 10px;"><a href="http://code.google.com/p/php-form-builder-class/" target="_blank">View in Google Code Project Hosting</a> | <a href="http://www.phpclasses.org/browse/package/5350.html" target="_blank">View in the PHP Classes Repository</a><br><a href="http://php-form-builder-class.googlecode.com/files/formbuilder.zip" target="_blank">Download Source from Google rode Project Hosting</a></div>
<a href="../index.php">Back to Project Home Page</a>
<p><b>Buttons</b> - This example demonstrates how buttons are handled within the class.
<?
$form = new form();
$form->setAttributes(array(
"tableAttributes" => array("width" => "400"),
));
$form->addHidden("cmd", "submit");
$form->addTextbox("Textbox:", "field0");
$form->addSelectbox("Selectbox:", "field1", "", array("" => "--Select an Option--", "option1" => "Option 1", "option2" => "Option 2"));
$form->addCheckbox("Checkbox:", "field2", "", array("option1" => "Option 1"));
//Add Standard Submit Button
$form->addButton();
//Add Non-Submit Button W/OnClick Event
$form->addButton("php.net", "button", array("onclick" => "window.location = \"http://www.php.net\";"));
/*
If your system has a utility in place for dynamically generating button images, you will want to utilize the phpFunction, phpParams, wrapLink, and hrefAttributes parameters. A sample is provided below of what this call might look like. View the source of class.form.php to learn more about these parameters.
$form->addButton("", "", array("phpFunction" => "RenderDynamicButton", "phpParams" => array("param1","param2"), "wrapLink" => 1, "linkAttributes" => array("href" => "http://www.php.net/")));
*/
$form->render();
?>
<a href="../index.php">Back to Project Home Page</a>
</body>
</html>
<?
}
?>
|