Bug #5043 [Com]: newest version of QuickForm rule does not work on date fields
| From: | perumer | Date: | Fri, 18 May 2007 11:57:31 +0000 |
| Subject: | Bug #5043 [Com]: newest version of QuickForm rule does not work on date fields | ||
| References: | 1 | Groups: | php.pear.doc |
| Request: | Send a blank email to pear-doc+get-9724@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=5043&edit=1
ID: 5043
Comment by: perumer
Reported By: perumer at the-magic-team dot de
Summary: newest version of QuickForm rule does not work on date
fields
Status: Bogus
Type: Bug
Package: Documentation
Operating System: Win XP
PHP Version: 4.3.8
New Comment:
instead of addRule, addGroupRule should be used here
Previous Comments:
------------------------------------------------------------------------
[2005-08-10 02:15:59] avb
You are trying to validate the value of the date element (which is an
array) by using a rule which is designed to validate scalar data. It
wouldn't work in previous releases either.
------------------------------------------------------------------------
[2005-08-09 19:13:17] lburnerheimerton at yahoo dot com
In the description,
$form->addElement('date', 'issuedDate', 'Issued Date: ');
should have written:
$form->addElement('date', 'dateOnline', 'Online Date: ');
Bug still valid, just correcting the description.
------------------------------------------------------------------------
[2005-08-09 17:23:54] lburnerheimerton at yahoo dot com
Description:
------------
$form->addElement('date', 'issuedDate', 'Issued Date: ');
....
$form->addRule('dateOnline', 'Please add an Online DATE',
'required',
null, 'server');
Test script:
---------------
<?php
require_once "HTML/QuickForm.php";
$form = new HTML_QuickForm('frmTest', 'get');
$form->addElement('date', 'dateOnline', 'Online Date: ');
$form->addElement('text', 'MyTextBox', 'What is your name?');
$form->addElement('submit', 'btnSubmit', 'Submit');
$form->addRule('dateOnline', 'Please add an ONLINE DATE',
'required',
null, 'server');
if ($form->validate()) {
$form->freeze();
}
$form->display();
?>
Expected result:
----------------
I expect it to process & display the frozen data
Actual result:
--------------
Notice: Array to string conversion in
c:\pear\lib\HTML\QuickForm\Rule\Required.php on line 39
Online Date: 01Jan2001
What is your name?
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=5043&edit=1