Re: QuickForm php warning using DB_DataObject_FormBuilder
| From: | Dan C | Date: | Mon, 27 Jun 2005 18:27:15 +0000 |
| Subject: | Re: QuickForm php warning using DB_DataObject_FormBuilder | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-19782@lists.php.net to get a copy of this message | ||
This is exactly what I just did before I checked my email, and you're
totally correct. It is a date field I changed to a string (hidden
field). I'd like to have certain fields (date_updated, date_added,
etc) that get filled in automatically when the form is submitted.
Currently I'm doing it like this but perhaps this is wrong:
preGenerateForm()
- sets the date fields to hidden
preProcessForm
- assigns the date field values using php date() function
Is there a better/more proper way to do this?
Thanks,
Dan
On 6/27/05, Justin Patrin <papercrane@gmail.com> wrote:
> On 6/27/05, Dan C <dankind@gmail.com> wrote:
> > Hi All,
> >
> > I'm getting this error when using the $form->toHtml method of quickForm:
> >
> > Warning: htmlspecialchars() expects parameter 1 to be string, array
> > given in /usr/local/lib/php/HTML/Common.php on line 140
> >
> > The form was created using DB_DataObject_Formbuilder, and this is only
> > happening in one specific instance, otherwise FormBuilder works great.
> >
> > Now... I'm not sure how to backstep and find out exactly which method
> > is calling that. Line 140 is inside the _getAttrString() method, which
> > seems to only be called by the getAttributes() method in Common.php.
> >
> > Running:
> > /usr/local/lib/php/HTML/QuickForm$ grep getAttr *
> >
> > I get 34 results in different files... can anyone recommend a better
> > way to debug this so I can find out what's causing this error?
> >
>
> Well you can always output the fill attr string in that function. Add
> an if(!is_string()) around your echo and see what the other attributes
> are. Are you perhaps replacing a date element with a text element?
> This could easily happen because of that as the defaults FormBuilder
> sets are for the date element.
>
> --
> Justin Patrin
>