FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=18683&edit=1

ID: 18683
Updated by: borz_off@cs.msu.su
Reported By: adam at eryjus dot com
Summary: $id with blanks not handled correctly
-Status: Open
+Status: Bogus
Type: Bug
Package: HTML_QuickForm2
Operating System: Fedora Core 14
Package Version: 0.6.0
PHP Version: 5.3.6
Roadmap Versions:
New Comment:

-Status: Open
+Status: Bogus
Spaces are not allowed in elements' id attributes. You can complain to
authors of HTML specification if you don't like this fact.


Previous Comments:
------------------------------------------------------------------------

[2011-07-25 06:10:40] eryjus

Description:
------------
From the QuickForm2 Tutorial, changed the $id of the form form
'tutorial' to 'test form'. The constructor did not recognize that the
form was submitted. Removed the space and the form works as expected.

Test script:
---------------
$form = new HTML_QuickForm2('test form');

$form->addDataSource(new HTML_QuickForm2_DataSource_Array(array(
'name' => 'Joe User'
)));

$fieldset = $form->addElement('fieldset')->setLabel('QuickForm2 tutorial
example');
$name = $fieldset->addElement('text', 'name', array('size' => 50,
'maxlength' => 255))
->setLabel('Enter your name:');
$submit = $fieldset->addElement('submit', null, array('value' =>
'Send!'));

if ($form->validate()) {
echo '<h1>Hello, ' . htmlspecialchars($name->getValue()) . '!</h1>';
exit;
}

echo $form;


Expected result:
----------------
After changing the name to 'World', I expect to see, "Hello, World!".

Actual result:
--------------
The form is displayed as if it was loaded for the first time, even with
all the defaults from the code.

------------------------------------------------------------------------

Search Discussions

  • Adam at Jul 26, 2011 at 1:38 am
    Edit report at http://pear.php.net/bugs/bug.php?id=18683&edit=1

    ID: 18683
    Comment by: adam@eryjus.com
    Reported By: adam at eryjus dot com
    Summary: $id with blanks not handled correctly
    Status: Bogus
    Type: Bug
    Package: HTML_QuickForm2
    Operating System: Fedora Core 14
    Package Version: 0.6.0
    PHP Version: 5.3.6
    Roadmap Versions:
    New Comment:

    Alexey,

    Thank you and understood.

    With that said, wouldn't it be prudent for the constructor to throw an
    exception when an invalid argument is passed to it (such as the illegal
    space)?


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-07-25 12:21:56] avb

    -Status: Open
    +Status: Bogus
    Spaces are not allowed in elements' id attributes. You can complain to
    authors of HTML specification if you don't like this fact.

    ------------------------------------------------------------------------

    [2011-07-25 06:10:40] eryjus

    Description:
    ------------
    From the QuickForm2 Tutorial, changed the $id of the form form
    'tutorial' to 'test form'. The constructor did not recognize that the
    form was submitted. Removed the space and the form works as expected.

    Test script:
    ---------------
    $form = new HTML_QuickForm2('test form');

    $form->addDataSource(new HTML_QuickForm2_DataSource_Array(array(
    'name' => 'Joe User'
    )));

    $fieldset = $form->addElement('fieldset')->setLabel('QuickForm2 tutorial
    example');
    $name = $fieldset->addElement('text', 'name', array('size' => 50,
    'maxlength' => 255))
    ->setLabel('Enter your name:');
    $submit = $fieldset->addElement('submit', null, array('value' =>
    'Send!'));

    if ($form->validate()) {
    echo '<h1>Hello, ' . htmlspecialchars($name->getValue()) . '!</h1>';
    exit;
    }

    echo $form;


    Expected result:
    ----------------
    After changing the name to 'World', I expect to see, "Hello, World!".

    Actual result:
    --------------
    The form is displayed as if it was loaded for the first time, even with
    all the defaults from the code.

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJul 25, '11 at 10:22a
activeJul 26, '11 at 1:38a
posts2
users2
websitepear.php.net

2 users in discussion

Borz_off: 1 post Adam: 1 post

People

Translate

site design / logo © 2022 Grokbase