Re: FormBuilder/elementTypeMap/date as text woes...

From: Date: Fri, 02 Feb 2007 21:27:14 +0000
Subject: Re: FormBuilder/elementTypeMap/date as text woes...
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-26489@lists.php.net to get a copy of this message
On 2/2/07, blmapson@verizon.net <blmapson@verizon.net> wrote:
Hello All, I am trying to integrate Frequency Decoder's Unobtrusive Date-Picker Widgit (http://www.frequency-decoder.com/2006/10/02/unobtrusive-date-picker-widgit-update/) into forms produced by FormBuilder. While I've got the date picker working quite well, I am getting the following error just above my form:
        Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\USR\php\PEAR\HTML\Common.php on line 150
For some reason, it appears that something doesn't like the elementTypeMap that I have set:
        $formBuilder->elementTypeMap = array('date' => 'text');
The following setting doesn't cause the errors:
        $formBuilder->elementTypeMap = array('date' => 'date');
For some reason, I am intent on using a text field for this... Looking into it a little deeper, I found that the following attributes are being inserted into the <input> tag.
        format="Y-m-d" language="en"
So, the question is... Is this behaviour normal, could it be a bug or am I missing something simple?
You need to override the dateToDatabaseCallback and databaseToDateCallback, otherwise FormBuilder will convert the date to an array and this error will happen. -- Justin Patrin

« previous php.pear.general (#26489) next »