[pmwiki-users] Multiple checkboxes
Petko Yotov
5ko at 5ko.fr
Wed Sep 23 13:35:23 CDT 2015
On 2015-09-22 18:51, Hans Bracker wrote:
> multiple input box ticking results in a PTV looking something like
> this:
>
> Hobby: Travels,Photography,Music
>
> which then would not populate input defaults correctly, ie. it needs
> spaces between values not commas!
>
> How can we resolve this? I could add a Fox config variable
> "$FoxPTVArraySeparator", which could be set to a comma or a space or
> even a comma and a space or what ever. I am not sure what a change in
> the default from comma to space would break for sites updating
> fox.php.
> Could PmWiki have a similar configuration variable, so instead of a
> space
> a comma could be used in a PTV holding array elements?
Yes, it could. The new feature was added recently and is not yet in the
core documentation so we can change it.
Currently "space" is a separator but not so simple: one can quote
strings containing spaces; this comes very handy from ParseArgs().
(:input default name[] val1 "val 2" val3 val4:)
-> note, may change!
Using a simple explode() with a separator is very easy but what happens
if one of the values contains the separator?
Also, the current markup for all input elements:
(:input ELEMENT name 1,2,3,4,somevalue:)
means that the "value" argument in the HTML input tag is
"1,2,3,4,somevalue". It is not very consistent to have ONE way to define
a value in (:input text name value:), (:input checkbox name value:) or
any other element, and ANOTHER in (:input default name value:).
I also also think that an existing PTV in the page should be able to
check/uncheck the checkboxes, by simply setting (:input default
source=1:).
Let me think about it.
Petko
--
Change log : http://www.pmwiki.org/wiki/PmWiki/ChangeLog
Release notes : http://www.pmwiki.org/wiki/PmWiki/ReleaseNotes
If you upgrade : http://www.pmwiki.org/wiki/PmWiki/Upgrades
More information about the pmwiki-users
mailing list