Login   Register  
PHP Classes
elePHPant
Icontem

File: example

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Abraham Salazar  >  Form Validate Class  >  example  >  Download  
File: example
Role: Example script
Content type: text/plain
Description: example script
Class: Form Validate Class
Generate forms with Javascript based validation
Author: By
Last change:
Date: 2005-09-14 20:40
Size: 1,932 bytes
 

Contents

Class file image Download
<?include("class_form_validate.php");
$Form = new FORM_VALIDATE;

if(
$send)
echo 
"<script>window.location.href='$PHP_SELF';</script>";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
    <title>EXAMPLE</title>
</head>

<body bgcolor="#008080">

<?

#uncoment this variables and refresh example.php page for view changes
/*
$firstname="First name here";
$lastname="Lastname here";
$sex="m";
$language="es";
$adress="Adress here";
$agree="iagree";
$username="Username here";
$pass="xxx";*/

$Form -> style ("<font color='#FFFFFF'><b> +label+ </b></font> <br> ");
$Form ->empty_value_error ("Please check  +field+ ");


$Form -> form_open ("form",$action="");

$id=5;
$Form -> input_hidden ("id","yes");?>
<table>

<tr><td><?$Form -> input_text ("firstname","First Name:","yes");?></td></tr>

<tr><td><?$Form -> input_text ("lastname","Last Name:","no");?></td></tr>

<tr>
    <td><?$radios[f]="Female";
          
$radios[m]="Male";
          
$Form -> radio_button ("sex",$radios,"yes","Sex:");?></td>
</tr>

<tr>
    <td><?$select_lang[false]="Please select your language"#key false for empty value
          
$select_lang[fr]="French [fr]";
          
$select_lang[es]="Spanish [es]";
          
$select_lang[en]="English [en]";
          
$Form -> select ("language",$select_lang,"yes","Language:");?></td>
</tr>

<tr><td><?$Form -> textarea ("adress","Address:","yes","35","7");?></td></tr>

<tr><td><?$Form -> file ("foto","Your display image:");?></td></tr>

<tr><td><?$Form -> checkbox ("agree","iagree","yes","I agree");?></td></tr>

<tr><td><?$Form -> input_text ("username","User Name:","yes");?></td></tr>

<tr><td><?$Form -> input_pass ("pass","Password","yes");?></td></tr>

<tr>
    <td><?$Form -> submit ("send","Send Form");
         echo 
"&nbsp;"$Form -> reset ("reset","Reset Form");?></td>
</tr>

</table>
<?$Form -> form_close ();?>

</body>
</html>