PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm » Bug #4131

Javascript group validation fails when group name is a number

Details

Submitted2005-04-12 21:03 UTC
Frompete at phunkymunky dot net
StatusWont fix
PackageHTML_QuickForm
PHP Version4.3.10
OSFC3
Roadmaps(Not assigned)

Comments

[2005-04-12 21:03 UTC] pete at phunkymunky dot net

Description:
------------
PEAR 1.3.5
QuickForm 3.2.4pl1

When creating a group rule for an element, if the group name is a number, the client side validation will fail. This is because the javascript variable name generated by RuleRegistry.php begins with a number also which is invalid for a javascript variable name.

To fix this, I replaced all instances of "{$elementName}Elements" with "q_{$elementName}Elements" in RuleRegistry.php. This has no effects on the function of the code, but squashes this bug immediately.

Actual result:
--------------
When using an unmodified RuleRegistry.php, the following javascript error is seen in the Javascript Console:

Error: missing variable name
Source File: http://<<site>>/participate.php?survey_id=5
Line: 69, Column: 6
Source Code:
var 1Elements = '::1[question_1]::1[question_1]::';
--^