[TYPO3-templavoila] fce: default value for input field - problems...

Peter Klein pmk at io.dk
Thu Oct 8 20:12:28 CEST 2009

Hi Stig.

You can render the field as type="user". Then you have full control over how 
it looks and what it contains..


FlexForm setup:
-- cut --
    <label>UserFunc Test</label>
-- cut --

PHP Script (Saved as: /myext/class.tx_userfunc.php)
-- cut --
class tx_userfunc {
 function customfield($PA, $fobj) {
  return '<input
     value="'.htmlspecialchars(($PA['itemFormElValue'] ? 
$PA['itemFormElValue']:'Default value')).'"
-- cut --

This will create a standard input field. If the field is empty, it will be 
prefiled with the value "'Default value".

Peter Klein

"Stig Nørgaard Færch" <snf at dkm.dk> wrote in message 
news:mailman.1.1255001854.16546.typo3-project-templavoila at lists.netfielders.de...
> Dmitry Dulepov skrev:
>> Hi!
>> Stig Nørgaard Færch wrote:
>>> I'm trying to get the current date as default for a input field.
>>> It seems to work for tt_news (datetime field), but if I put this:
>>> mktime(date("H"),date("i"),0,date("m"),date("d"),date("Y"))
>>> into the default field, it will not be processed and will just display
>>> exactly mktime(date("H"),date("i"),0,date("m"),date("d"),date("Y")).
>> You cannot really expect PHP function to be executed in XML ;)
> Doh - yes - I see.
> So I guess it's not possible to get dynamic default values?
> /Stig 

More information about the TYPO3-project-templavoila mailing list