Source of: /ADI/validation/javascript_validation.php

<?php
require_once "HTML/Template/IT.php";

// Cria um novo objecto template
 
$template = new HTML_Template_IT('.');

// Carrega o template
 
$template->loadTemplatefile('javascript_validation.tpl', true, true);

$template->setVariable("MESSAGE", "Preencha os campos em baixo.");
$template->setVariable("SUBMITVALUE", "Enviar");
$template->setVariable("FORMNAME", "custform");
$template->setVariable("SUBMITACTION", "
document.custform.firstname.hasNospaces = true ;
document.custform.firstname.description = 'First Name';
document.custform.surname.description = 'Last Name';
document.custform.address.description = 'Address';
document.custform.email.description = 'Email';
document.custform.email.isEmail = true;
document.custform.dob.isDate = true;
document.custform.dob.description = 'Data de Nascimento (99/99/9999)';
document.custform.salary.description = 'Salário';
document.custform.salary.isNumeric = true;
document.custform.salary.minNumber = 1;
document.custform.salary.maxNumber = 10000;
document.custform.salary.hasNospaces = true;
return (verify(document.custform));"
);

$template->setCurrentBlock("mandatoryinput");
$template->setVariable("MINPUTTEXT","First name");
$template->setVariable("MINPUTNAME","firstname");
$template->setVariable("MINPUTVALUE","");
$template->setVariable("MINPUTSIZE",50);
$template->parseCurrentBlock("mandatoryinput");

$template->setCurrentBlock("mandatoryinput");
$template->setVariable("MINPUTTEXT","Surname");
$template->setVariable("MINPUTNAME","surname");
$template->setVariable("MINPUTVALUE","");
$template->setVariable("MINPUTSIZE",50);
$template->parseCurrentBlock("mandatoryinput");

$template->setCurrentBlock("mandatoryinput");
$template->setVariable("MINPUTTEXT","Address");
$template->setVariable("MINPUTNAME","address");
$template->setVariable("MINPUTVALUE","");
$template->setVariable("MINPUTSIZE",50);
$template->parseCurrentBlock("mandatoryinput");

$template->setCurrentBlock("mandatoryinput");
$template->setVariable("MINPUTTEXT","Data de Nascimento (dd/mm/yyyy)");
$template->setVariable("MINPUTNAME","dob");
$template->setVariable("MINPUTVALUE","");
$template->setVariable("MINPUTSIZE",50);
$template->parseCurrentBlock("mandatoryinput");

$template->setCurrentBlock("mandatoryinput");
$template->setVariable("MINPUTTEXT","Email");
$template->setVariable("MINPUTNAME","email");
$template->setVariable("MINPUTVALUE","");
$template->setVariable("MINPUTSIZE",30);
$template->parseCurrentBlock("mandatoryinput");

$template->setCurrentBlock("mandatoryinput");
$template->setVariable("MINPUTTEXT","Salário Liquido (em euros)");
$template->setVariable("MINPUTNAME","salary");
$template->setVariable("MINPUTVALUE","");
$template->setVariable("MINPUTSIZE",6);
$template->parseCurrentBlock("mandatoryinput");

$template->show();

?>