Re: Quickform suggestion

From: Date: Wed, 23 Apr 2003 12:41:43 +0000
Subject: Re: Quickform suggestion
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-15379@lists.php.net to get a copy of this message
<wolff@21st.de> wrote : > Bertrand Mansion wrote: > >> $form->addElement('text', 'elName', 'Label:', >> array('size' => 40)); >> >> You can use as much attributes you want, they are parsed by HTML_Common. >> You could also do this, HTML_Common knows how to handle it: >> >> $form->addElement('text', 'elName', 'Label:', >> 'size=40 maxlength=40'); > > Hi Bertrand and Alexey, > > thanks for your answers. I have indeed missed the fact that it´s > possible to pass more attributes along... thanks for pointing that one > out. > > However, there´s one more issue I´ve just stumbled upon when trying > out the file upload feature - there doesn´t seem to be a built-in way > to retrieve the original name of a file. > > With normal text fields, I can do something like this to get the contents: > > $content = $form->getElementValue('myElement'); $form->getUploadedFile('myFileField'); > When I try the same on a file element, $content remains empty. Is this > a bug? I can of course access the values via $_FILES or use a callback > method to process the form data (which receives all values from > $_FILES as an array), but that seems quite cheesy... > > Also, is there some method that simply returns the same data array > that a callback function would receive as its parameter? $form->process('myFunction'); Good luck, Bertrand Mansion Mamasam

« previous php.pear.dev (#15379) next »