[pmwiki-users] PmForms Default value for input
DaveG
pmwiki at solidgone.com
Sat Dec 27 10:58:31 CST 2008
The answer is here: http://www.pmwiki.org/wiki/Cookbook/InputDefault
Specify the default values separate from the (:input declarations. Note
the lines with no ">" prefix below.
> [[#entry-form]]
> (:input pmform target=tmp:)
> (:input default source={*$FullName} :)
> (:input default request=1 :)
(:input default $:entrydate "{(ftime)}":)
> (:messages:)
Date: (:input text $:entrydate size=25 :)
> (:input submit value="Submit":)
> (:input end:)
> [[#entry-formend]]
DaveG wrote:
> When creating a form template, specifying a 'default' value overrides
> any values brought in from source:
>
> [[#entry-form]]
> (:input pmform target=tmp:)
> (:input default source={*$FullName} :)
> (:input default request=1 :)
> (:messages:)
> Date: (:input text $:entrydate size=25 default="{(ftime)}":)
> (:input submit value="Submit":)
> (:input end:)
> [[#entry-formend]]
>
> (Use this post, for example)
> [[#entry-post]]
> (:template defaults saveto="{*$FullName}" :)
> (:template defaults savevars=$:entrydate :)
> [[#entry-postend]]
>
> And in config.php:
> $PmForm['tmp'] = 'saveto={$FullName} form=#entry-form fmt=#entry-post';
>
>
> Above, the date is filled correctly on first load, but subsequent uses,
> the default overrides the initial value.
>
> Is this a bug, or am I using this wrong?
>
>
> ~ ~ Dvae
>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>
More information about the pmwiki-users
mailing list