[pmwiki-users] Building form with arbitrary data
Petko Yotov
5ko at 5ko.fr
Sun Oct 21 09:21:31 CDT 2012
V.Krishn writes:
> On Sunday, October 21, 2012 11:20:39 AM Petko Yotov wrote:
> > V.Krishn writes:
> > > On Saturday, October 20, 2012 07:02:28 AM Petko Yotov wrote:
> > > > This page may be helpful:
> > > > http://www.pmwiki.org/wiki/Cookbook/InputDefault
> > >
> > > Thanks, I think this should help.
> > >
> > > 1. Also can there be support for multiple select,
> > > as suggested in comments on this page.
> > >
> > > I tried making some changes to InputToHTML function:
> > > $opt[$checked] = in_array(@$opt['value'],
> > >
> > > (array)explode(',',str_replace(' ','', $InputValues[$name])))
> > >
> > > ? $checked : false;
> >
> > You don't need this change, just set your $InputValues as an array:
> >
> > $InputValues['color'] = array('red', 'green');
>
> :-) This allows multiple defaults.
>
> I was trying to set with (:input default .....
> Is this already implemented?
> If not I would vote/request for such feature.
You said that you needed to set this in a script, and you can. If you can
modify the wiki page containing the form, you can also set the "checked"
state directly in the markup (:input checkbox color red checked=checked:).
So you don't really need this in a wiki page either. :-)
Petko
More information about the pmwiki-users
mailing list