PHP Classes

File: example_small.php

Recommend this page to a friend!
  Classes of Jonas Earendel  >  jForm Validator  >  example_small.php  >  Download  
File: example_small.php
Role: Example script
Content type: text/plain
Description: A small example
Class: jForm Validator
Validate forms with rules defined in form template
Author: By
Last change: Apparently I forgot to change sv_se to sv-SE.
Date: 3 years ago
Size: 932 bytes


Class file image Download


$html = '
    E-mail:<br />
    <input type="email" name="email" required="required" value="" /><br />

    Url:<br />
    <input type="url" name="url" required="required" value="#" /><br />

$form = new jForm($html,'sv-SE');

$_POST) and $form -> validate($_POST))
$form->triggerError('The form has passed validation','email');
$form->triggerError('The form has passed validation','url');

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
    <title>jForm php form validation demo!</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<form method="post" action="">
    <?php echo $form->html4(); ?>
<input type="submit" />