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 #4832

Js Error "validate_xxx is not defined" when Freeze and client validation rules

Details

Submitted2005-07-14 02:40 UTC
Fromkenchou77 at gmail dot com
Assignedavb
StatusClosed
PackageHTML_QuickForm
PHP Version4.3.11
Roadmaps(Not assigned)

Comments

[2005-07-14 02:40 UTC] kenchou77 at gmail dot com

Description:
------------
I'm using freeze() to display a preview page.
but when submit again I got a Javascript Error "validate_xxx is not defined".
or have a better way to preview a form?

I'm useing HTML_QuickForm 3.2.4pl1(stable)

Reproduce code:
---------------
$form =& new HTML_QuickForm('frmTest', 'get');
$form->addElement('text', 'itxtTest', 'Test Text:');
$form->addElement('submit', 'btnSubmit', 'Submit');

$form->addRule('itxtTest', 'Test Text is a required field', 'required', NULL, 'client');

if ($form->validate()) {
$form->freeze();
}
$form->display();

Expected result:
----------------
<script type="text/javascript">
//<![CDATA[
function validate_frmTest(frm) {
//...
}
//]]>
</script>
<form ... onsubmit="return validate_frmTest(this);">

Actual result:
--------------
//here missing validate js code when freeze

<form ... onsubmit="return validate_frmTest(this);">