<?php
include_once('class.jForm.php');
$html = '
E-mail:<br />
<input type="email" name="email" required="required" value="john@doe.com#" /><br />
Url:<br />
<input type="url" name="url" required="required" value="#http://jform.lagerwall.net/" /><br />
';
$form = new jForm($html,'sv-SE');
if(!empty($_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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jForm php form validation demo!</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<form method="post" action="">
<?php echo $form->html4(); ?>
<input type="submit" />
</form>
</body>
</html>
|