[pmwiki-users] Building form with arbitrary data

V.Krishn vkrishn4 at gmail.com
Sun Oct 21 10:23:44 CDT 2012


On Sunday, October 21, 2012 07:51:31 PM Petko Yotov wrote:
> 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. :-)
> 

I think the use of $InputValues should solve the issue.
Would try to build the script using it, in other places checked=checked would 
be helpful.

Just to know, while thinking over this issue, I made alternate function 
str_getcsv() for php 4+.  Please let me know if its required in any recipe.

Thanks.

-- 
Regards.
V.Krishn

> Petko
> 
> 
> _______________________________________________
> 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