PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTML » HTML_QuickForm » Bug #7200

ceck validation with javascript using Smarty

Details

Submitted2006-03-24 21:49 UTC
Fromandrea dot loriz at libero dot it
StatusBogus
PackageHTML_QuickForm
PHP Version5.0.0
OSLinux
Roadmaps(Not assigned)

Comments

[2006-03-24 21:49 UTC] andrea dot loriz at libero dot it

Description:
------------
I try to use QuickForm with Javascript check and Smarty.
But client side check (with Java don't work).

Test script:
---------------
I try to use QuickForm with Javascript check, for each field I use two check: by server and by client (with javascript):

$smarty = new Smarty;
$smarty->template_dir='template_dir/';
$smarty->compile_dir='compile_dir/';
$smarty->caching=false;
[...]
$form->addElement('text','name','');
$form->addRule('name','insert name',required);
$form->addRule('name','insert name',required,null,'client');
[...]

$render=& new HTML_QuickForm_Renderer_ArraySmarty($smarty);

f($form->validate())
{
$form->freeze();
$form->accept($render);
$smarty->assign('form',$render->toArray());
$smarty->display('page.tpl');
}
else
{
$form->accept($render);
$smarty->assign('form',$render->toArray());
$smarty->display('page.tpl');
}

Te pemplate is:

<!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"><!-- InstanceBegin template="/Templates/index.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<title>GARR_06 "e-Infrastrutture per lo sviluppo"</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<style type="text/css">
<!--
-->
</style>
<link href="css/conf_06_stile.css" rel="stylesheet" type="text/css" media="screen"/>
<link href="css/conf_06_stampa.css" rel="stylesheet" type="text/css" media="print"/>
<style type="text/css">
<!--

-->
</style>

{$form.javascript}
{literal}
<script type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) {
window.open(theURL,winName,features);
}
//-->
</script>
{/literal}
</head>
<body>
[...]

<form {$form.attributes} >
{$form.hidden}

<p><span class="asterisco">*</span><a name="form" id="form"><span class="modulo">Nome:</span><br />
{$form.nome.html}
<span style="color:#FF0000;">{$form.errors.nome}</span>
[...]

Expected result:
----------------
java window alert!

Actual result:
--------------
no java window alert!