Re: Re: [PEAR] FormBuilder/elementTypeMap/date as text woes...
| From: | blmapson at verizon dot net | Date: | Fri, 02 Feb 2007 22:02:49 +0000 |
| Subject: | Re: Re: [PEAR] FormBuilder/elementTypeMap/date as text woes... | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-26491@lists.php.net to get a copy of this message | ||
Justin,
Thank you very much. This did the trick!
- Brian
>From: Justin Patrin <papercrane@gmail.com>
>Date: 2007/02/02 Fri PM 03:27:14 CST
>To: "blmapson@verizon.net" <blmapson@verizon.net>
>Cc: pear-general@lists.php.net
>Subject: Re: [PEAR] FormBuilder/elementTypeMap/date as text woes...
>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
>
>--
>PEAR General Mailing List (http://pear.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php