Re: QF, setting textarea value(?)

From: Date: Sat, 04 Oct 2003 19:00:09 +0000
Subject: Re: QF, setting textarea value(?)
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-8280@lists.php.net to get a copy of this message
<marba126@student.liu.se> wrote : > Hi! > > I have a textarea and a file element in my form. I want to the content of > the text file that has been uploaded, to append to the content of the > textarea. > > The only way I've managed to do this is by concatenating the contents of the > file directly to the _submitValues[...] variable of the QF-object. However, > I suppose this isn't a preferred way because I have to use a "private" > variable. > > I've tried using the setValue() method of the textarea-object and > updateElementAttr() as well as the updateAttributes() method of the > QF-object. Unfortenately, all these seems to get overridden by the submitted > values when "reloading" the form. > > By the way, the HTML textarea dosen't really have an 'value' attribute, has > it? Could that be the reason why updateElementAttr() and updateAttributes() > fails? Nonetheless, the quickform-element textarea does have an attribute > 'value' that you can operate upon with setValue()/getValue(). This might be > a bit missleading maybe. > > > Any help to sort things out here is greatly appreciated! I might very well > be missing some fundamentals. You can use setConstants(), it overides both default values (setDefaults()) and submitted values. BTW, in a textarea element, there in no value attribute as its content is the data between the tags. Bertrand Mansion Mamasam

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